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

why the 'g' prefix on the SHA1 in git-describe output?

From
Jim Meyering <jim@meyering.net>
Date
Nov 3, 2007, 12:25 UTC
Message-ID
<871wb7a53d.fsf@rho.meyering.net>
Hello,

Can anyone tell me what motivated adding the 'g' prefix on the SHA1 in git-describe output? Is there some version-parsing/comparing tool that misbehaves on a component like the SHA1 that would otherwise start with a digit but contain non-numeric bytes, too?

Why do I ask? Because I'm using a bastardized version of GIT-VERSION-GEN in coreutils' build-aux/git-version-gen, and removed the 'g' to shorten the string by a byte. If there's a good reason (i.e., other than vanity :-) for the 'g', I'll propose comments for GIT-VERSION-GEN, so others don't do what I've done.

Jim
Next: Lars Hjemli
Message 1 of 4 in “why the 'g' prefix on the SHA1 in git-describe output?”
  1. Jim MeyeringNov 3, 2007
  2. Lars HjemliNov 3, 2007
  3. Andreas EricssonNov 3, 2007
  4. Jim MeyeringNov 3, 2007

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.