From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shawn Pearce Subject: Re: [PATCH] sha1_name: accept output of git-describe Date: Wed, 20 Sep 2006 17:34:10 -0400 Message-ID: <20060920213410.GC24415@spearce.org> References: <7v64figrhu.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Johannes Schindelin , git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Sep 20 23:34:31 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GQ9hy-00018V-Tl for gcvg-git@gmane.org; Wed, 20 Sep 2006 23:34:19 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932136AbWITVeQ (ORCPT ); Wed, 20 Sep 2006 17:34:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932139AbWITVeQ (ORCPT ); Wed, 20 Sep 2006 17:34:16 -0400 Received: from corvette.plexpod.net ([64.38.20.226]:41430 "EHLO corvette.plexpod.net") by vger.kernel.org with ESMTP id S932136AbWITVeP (ORCPT ); Wed, 20 Sep 2006 17:34:15 -0400 Received: from cpe-74-70-48-173.nycap.res.rr.com ([74.70.48.173] helo=asimov.home.spearce.org) by corvette.plexpod.net with esmtpa (Exim 4.52) id 1GQ9hj-0006nV-KP; Wed, 20 Sep 2006 17:34:03 -0400 Received: by asimov.home.spearce.org (Postfix, from userid 1000) id E163620E48E; Wed, 20 Sep 2006 17:34:10 -0400 (EDT) To: Junio C Hamano Content-Disposition: inline In-Reply-To: <7v64figrhu.fsf@assigned-by-dhcp.cox.net> User-Agent: Mutt/1.5.11 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - corvette.plexpod.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - spearce.org X-Source: X-Source-Args: X-Source-Dir: Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Junio C Hamano wrote: > Johannes Schindelin 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.