From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 2/3] name-rev: strip trailing ^0 in when --name-only
Date: Mon, 8 Jul 2013 18:30:07 +0530 [thread overview]
Message-ID: <CALkWK0mrOfx-EfS3YfS7mMBKqjFrwcyiVmQO=wMLN-BH1avqBg@mail.gmail.com> (raw)
In-Reply-To: <7vd2qu44mm.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> But I do not think "name-rev" is limited
> to commits, in the sense that you would see this:
>
> $ git rev-parse v1.8.3 v1.8.3^0 | git name-rev --stdin
> 8af06057d0c31a24e8737ae846ac2e116e8bafb9
> edca4152560522a431a51fc0a06147fc680b5b18 (tags/v1.8.3^0)
>
> The second object is _not_ v1.8.3 but is v1.8.3^0 in the context of
> name-rev, whose purpose is to give you a string you can feed
> "rev-parse" and get the object name back. "rev-parse v1.8.3" will
> not give you the commit object name, so you need to keep "^0".
Quite frankly, I thought the unstripped ^0 in one codepath was an
unintended quirk. What exactly do you want name-rev to give you?
$ git tag foo @^
$ git name-rev foo
foo tags/foo
So you can distinguish between annotated tags, unannotated tags, and
head-refs. Can you get it to tell you anything reliably though?
$ git tag bar @
$ git tag -a baz @
$ git name-rev @
$ git name-rev bar
$ git name-rev baz
ref, annotated, or unannotated tag? I do not think name-rev is
fundamentally different from describe: it is also only dependent on
the commit history graph. Whether I specify a revision using @, HEAD,
baz, or bar, I should get the same answer (it's just a recursive
peeler). I'm not sure what you gain by knowing the object type of the
output. If you wanted to feed something into rev-parse and get out a
commit, you'd send in $REV^0 without bothering about what it is, no?
next prev parent reply other threads:[~2013-07-08 13:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-07 12:43 [PATCH 0/3] Iron output of describe --contains --all Ramkumar Ramachandra
2013-07-07 12:43 ` [PATCH 1/3] name-rev: fix assumption about --name-only usage Ramkumar Ramachandra
2013-07-07 18:18 ` Junio C Hamano
2013-07-08 13:18 ` Ramkumar Ramachandra
2013-07-07 12:43 ` [PATCH 2/3] name-rev: strip trailing ^0 in when --name-only Ramkumar Ramachandra
2013-07-07 18:16 ` Junio C Hamano
2013-07-07 22:03 ` Junio C Hamano
2013-07-08 13:00 ` Ramkumar Ramachandra [this message]
2013-07-07 12:43 ` [PATCH 3/3] name-rev doc: rewrite --stdin paragraph Ramkumar Ramachandra
2013-07-07 18:04 ` Junio C Hamano
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='CALkWK0mrOfx-EfS3YfS7mMBKqjFrwcyiVmQO=wMLN-BH1avqBg@mail.gmail.com' \
--to=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).