From: Shawn Pearce <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: [PATCH] sha1_name: accept output of git-describe
Date: Wed, 20 Sep 2006 17:34:10 -0400 [thread overview]
Message-ID: <20060920213410.GC24415@spearce.org> (raw)
In-Reply-To: <7v64figrhu.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Now, 'git log $(git describe)' does the same as 'git log'.
> >
> > NOTE: it might be possible that the unique abbreviation generated by
> > git-describe is no longer unique at a later stage. Evidently, in this
> > case the sha1 resolution fails.
[snip]
> Shouldn't you also verify the leading ref (most likely a tag)
> exists (and optionally check that it precedes the commit you
> decoded into, but that is probably more expensive than it's
> worth)?
I thought the same thing when I first posted that it was probably
an easy change to this code (and then didn't do it myself) and
again when I read Johannes' implementation. Both times I agreed
with you Junio that it was probably too expensive and not worth
doing.
Most of the time we assume not only that the SHA1 itself is unique
but also that it some hex character prefix is unique (such as 6 or
8 digits). One might be able to argue that if we have duplicate
commits (when abbreviated) that you might be able to break the tie by
looking at the tag but even then you may not always be able to do so.
So no, probably not worth it...
--
Shawn.
prev parent reply other threads:[~2006-09-20 21:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-20 20:56 [PATCH] sha1_name: accept output of git-describe Johannes Schindelin
2006-09-20 21:25 ` Junio C Hamano
2006-09-20 21:31 ` Johannes Schindelin
2006-09-20 21:34 ` Shawn Pearce [this message]
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=20060920213410.GC24415@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.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).