git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-push: forced update of tag shows unabbreviated SHA1

From
Jeff King <peff@peff.net>
Date
Jan 31, 2008, 10:06 UTC
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
Previous: Johannes SixtNext: Junio C Hamano
Message 4 of 9 in “git-push: forced update of tag shows unabbreviated SHA1”
  1. Johannes SixtJan 31, 2008
  2. Junio C HamanoJan 31, 2008
  3. Johannes SixtJan 31, 2008
  4. Jeff KingJan 31, 2008
  5. Junio C HamanoJan 31, 2008
  6. Jeff KingJan 31, 2008
  7. Jeff KingJan 31, 2008
  8. Junio C HamanoJan 31, 2008
  9. Jeff KingJan 31, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.