rev-list-options.txt: update --all about detached HEAD
PATCH 1/1 rev-list-options.txt: update --all about detached HEAD
This is the document patch for f0298cf1c6 (revision walker: include a detached HEAD in --all - 2009-01-16)
--- Documentation/rev-list-options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/rev-list-options.txt +2 -2
@@ -133,8 +133,8 @@ parents) and `--max-parents=-1` (negative numbers denote no upper limit). for all following revision specifiers, up to the next `--not`. --all:: - Pretend as if all the refs in `refs/` are listed on the - command line as '<commit>'. + Pretend as if all the refs in `refs/` (and HEAD if detached) + are listed on the command line as '<commit>'. --branches[=<pattern>]:: Pretend as if all the refs in `refs/heads` are listed
Signature · 1 line
2.11.0.157.gd943d85
Documentation/rev-list-options.txt parents) and `--max-parents=-1` (negative numbers denote no upper limit). · line 137
Quoted 8 lines · Nguyễn Thái Ngọc Duy
This is the document patch for
f0298cf1c6(revision walker: include a detached HEAD in --all - 2009-01-16)
[...]
--all::Documentation/rev-list-options.txt +2
-2- Pretend as if all the refs in `refs/` are listed on the - command line as '<commit>'. + Pretend as if all the refs in `refs/` (and HEAD if detached) + are listed on the command line as '<commit>'.
I think this is an improvement, but I'm not sure about the "if detached" bit. We always read HEAD, no matter what.
If you only care about reachability, then reading HEAD only has an impact if it is detached, since otherwise we know that we will grab the ref via refs/.
I'm not sure if it would matter for some other cases, though. For example, with "--source", do we report HEAD or the matching ref? It looks like the latter (because we read the refs first).
I suspect you could also construct a case with excludes like:
$ git checkout foo $ git rev-list --exclude=refs/heads/foo --all
where it is relevant that we read HEAD separately from refs/heads/foo.
So I think just "and HEAD" is better, like:
Pretend as if all the refs in refs/, along with HEAD, are listed...
-Peff
PATCH v2 1/1 rev-list-options.txt: update --all about HEAD
In reply to Nguyễn Thái Ngọc DuyThis is the document patch for f0298cf1c6 (revision walker: include a detached HEAD in --all - 2009-01-16).
Even though that commit is about detached HEAD, as Jeff pointed out, always adding HEAD in that case may have subtle differences with --source or --exclude. So the document mentions nothing about the detached-ness.
---
v2 drops "detached".
Documentation/rev-list-options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/rev-list-options.txt +2 -2
@@ -133,8 +133,8 @@ parents) and `--max-parents=-1` (negative numbers denote no upper limit). for all following revision specifiers, up to the next `--not`. --all:: - Pretend as if all the refs in `refs/` are listed on the - command line as '<commit>'. + Pretend as if all the refs in `refs/`, along with `HEAD`, are + listed on the command line as '<commit>'. --branches[=<pattern>]:: Pretend as if all the refs in `refs/heads` are listed
Signature · 1 line
2.11.0.157.gd943d85
Re: [PATCH v2] rev-list-options.txt: update --all about HEAD
Quoted 11 lines · Nguyễn Thái Ngọc Duy
This is the document patch for
f0298cf1c6(revision walker: include a detached HEAD in --all - 2009-01-16).Even though that commit is about detached HEAD, as Jeff pointed out, always adding HEAD in that case may have subtle differences with --source or --exclude. So the document mentions nothing about the detached-ness.
Signed-off-by Nguyễn Thái Ngọc Duy <[email protected]>---
v2 drops "detached".
Thanks. Seems like an obvious improvement to me.
-Peff