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

From: Shawn Pearce <spearce@spearce.org>
Date: 2006-09-21 07:34:10
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.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Sep 21 07:34:21 2006

This archive was generated by hypermail 2.1.8 : 2006-09-21 07:35:01 EST