From: Jeff King Date: Thu, 31 Jan 2008 10:06:25 GMT Subject: Re: git-push: forced update of tag shows unabbreviated SHA1 Message-ID: <20080131100625.GB25546@coredump.intra.peff.net> In-Reply-To: <47A1948F.6080308@viscovery.net> On Thu, Jan 31, 2008 at 10:27:43AM +0100, Johannes Sixt wrote: > When a tag is changed to point to a new commit, then the tag is pushed to > a repo that still has the old tag, it is correctly pushed, but the old > SHA1 is reported with all 40 digits: As Junio noted, this is because find_unique_abbrev returns NULL for objects we don't have. Actually, it is somewhat worse -- we return an erroneous abbreviation in the rare case that we are trying to find the abbreviation for something we don't have, but for which we do have a matching abbreviation. For example, if we have 1234567890123456789012345678901234567890 then for every 12345678* that we don't have, we will claim the correct abbreviation is 1234568. In practice, I doubt this is a problem. But getting back to your point: yes, I agree it is a little ugly. Rewriting find_unique_abbrev would be necessary for fixing it, and I'm not sure it is worth the trouble. -Peff