Subject: Re: [PATCH] sha1_name: accept output of git-describe

From: Shawn Pearce <[email-masked]>
Date: Wed, 20 Sep 2006 17:34:10 -0400

Junio C Hamano <[email-masked]> wrote:
> Johannes Schindelin <[email-masked]> 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.