git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] rev-list-options.txt: update --all about detached HEAD
Date: Tue, 7 Feb 2017 14:42:39 -0500	[thread overview]
Message-ID: <20170207194239.icyqawhja2losjul@sigill.intra.peff.net> (raw)
In-Reply-To: <20170207133850.14056-1-pclouds@gmail.com>

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

  reply	other threads:[~2017-02-07 19:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170207194239.icyqawhja2losjul@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).