git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Kirillov <max@max630.net>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Paul Mackerras <paulus@samba.org>,
	git@vger.kernel.org
Subject: Re: [PATCH] rev-parse: include HEAD in --all output
Date: Mon, 1 Sep 2014 00:36:06 +0300	[thread overview]
Message-ID: <20140831213606.GB6385@wheezy.local> (raw)
In-Reply-To: <20140831153054.GD17449@peff.net>

On Sun, Aug 31, 2014 at 11:30:54AM -0400, Jeff King wrote:
> On Sun, Aug 31, 2014 at 01:24:48AM +0300, Max Kirillov wrote:
> 
>> for_each_ref() does not include it itself, and without
>> the hash the detached HEAD may be missed by some
>> frontends (like gitk).
>> 
>> Add test which verifies the head is returned
>> 
>> Update test t6018-rev-list-glob.sh which relied on exact
>> list of returned hashes.
> 
> I think the missing bit of the justification here is that
> "--all" _does_ include HEAD in other contexts (like in
> git-log), and rev-parse should probably match it.
> 
> This is probably the right thing to do. It's possible that
> some caller of rev-parse really depends on "--all" meaning
> "just the refs", but I kind of doubt it. Being in sync
> with the revision.c parser seems saner.

Actually, yes, this is a bit incompatible change, and while
I'm pretty sure that rev-parse returning hashes should
include detached HEAD, returning HEAD when it's called with
something like "--symbolic" might be questioned. It could
depend on the output mode (add HEAD only if printing hashes)
but this kind of logic does not look good. So maybe some
more opinions should be asked for.

btw, manpage for git-rev-parse says "Show all refs found in
refs/.", should it also be changed?

-- 
Max

  reply	other threads:[~2014-08-31 21:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 14:18 [RFC] add detached HEAD to --all listing Max Kirillov
2014-08-27 14:22 ` Jeff King
2014-08-27 14:33   ` Max Kirillov
2014-08-30 22:24     ` [PATCH] rev-parse: include HEAD in --all output Max Kirillov
2014-08-31 15:30       ` Jeff King
2014-08-31 21:36         ` Max Kirillov [this message]
2014-09-02 16:59           ` Junio C Hamano
2014-09-03 16:18             ` Max Kirillov

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

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

  git send-email \
    --in-reply-to=20140831213606.GB6385@wheezy.local \
    --to=max@max630.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=paulus@samba.org \
    --cc=peff@peff.net \
    /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.
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 NNTP newsgroup(s).