git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] rev-list-options.txt: update --all about detached HEAD
@ 2017-02-07 13:38 Nguyễn Thái Ngọc Duy
  2017-02-07 19:42 ` Jeff King
  2017-02-08  6:06 ` [PATCH v2] rev-list-options.txt: update --all about HEAD Nguyễn Thái Ngọc Duy
  0 siblings, 2 replies; 4+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2017-02-07 13:38 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, 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)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Documentation/rev-list-options.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 5da7cf5a8d..72212ac6ec 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -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
-- 
2.11.0.157.gd943d85


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] rev-list-options.txt: update --all about detached HEAD
  2017-02-07 13:38 [PATCH] rev-list-options.txt: update --all about detached HEAD Nguyễn Thái Ngọc Duy
@ 2017-02-07 19:42 ` Jeff King
  2017-02-08  6:06 ` [PATCH v2] rev-list-options.txt: update --all about HEAD Nguyễn Thái Ngọc Duy
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff King @ 2017-02-07 19:42 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git, Junio C Hamano

On Tue, Feb 07, 2017 at 08:38:49PM +0700, Nguyễn Thái Ngọc Duy wrote:

> This is the document patch for f0298cf1c6 (revision walker: include a
> detached HEAD in --all - 2009-01-16)
> [...]
>  --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>'.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] rev-list-options.txt: update --all about HEAD
  2017-02-07 13:38 [PATCH] rev-list-options.txt: update --all about detached HEAD Nguyễn Thái Ngọc Duy
  2017-02-07 19:42 ` Jeff King
@ 2017-02-08  6:06 ` Nguyễn Thái Ngọc Duy
  2017-02-08 23:01   ` Jeff King
  1 sibling, 1 reply; 4+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2017-02-08  6:06 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jeff King, 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 <pclouds@gmail.com>
---
 v2 drops "detached".

 Documentation/rev-list-options.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 5da7cf5a8d..a02f7324c0 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -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
-- 
2.11.0.157.gd943d85


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] rev-list-options.txt: update --all about HEAD
  2017-02-08  6:06 ` [PATCH v2] rev-list-options.txt: update --all about HEAD Nguyễn Thái Ngọc Duy
@ 2017-02-08 23:01   ` Jeff King
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff King @ 2017-02-08 23:01 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git, Junio C Hamano

On Wed, Feb 08, 2017 at 01:06:41PM +0700, Nguyễn Thái Ngọc Duy wrote:

> 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 <pclouds@gmail.com>
> ---
>  v2 drops "detached".

Thanks. Seems like an obvious improvement to me.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-08 23:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 13:38 [PATCH] rev-list-options.txt: update --all about detached HEAD Nguyễn Thái Ngọc Duy
2017-02-07 19:42 ` Jeff King
2017-02-08  6:06 ` [PATCH v2] rev-list-options.txt: update --all about HEAD Nguyễn Thái Ngọc Duy
2017-02-08 23:01   ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).