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

Re: Pinned references?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 19, 2026, 16:25 UTC
Message-ID
<xmqqeci2lcpc.fsf@gitster.g>
In-Reply-To
<ajTx9vLIWK5wvTHM@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 21 quoted lines
> You can already kind of do this:
>
>     $ git rev-parse v2.54.0
>     0b13e48a3a30cdfa94e8ef842e24d6045ab3d015
>
>     $ git rev-parse v2.54.0-0-g0b13e48a3
>     0b13e48a3a30cdfa94e8ef842e24d6045ab3d015
>
>     $ git rev-parse v2.54.0-0-g95e20213f
>     95e20213faefeb95df29277c58ac1980ab68f701
>
> This is described under gitrevisions(7), `<describeOutput>`. The only
> gotcha is that this format will not verify that the tag and the object
> ID actually match. But other than that it gives you the ability to have
> both the human-readable name and the machine-readable commit ID in
> there.
>
> As said, we don't verify that those two revisions actually match. So in
> the case where they don't the result is certainly going to be lots of
> confusion. It certainly is one of the more surprising syntaxes that we
> have in Git.

It is very unlikely we would change this, but it is a fun thought experiment to imagine what would have happened if we insisted (i.e., verified and then died if it does not hold true) on the presence of v2.54.0 tag and when the "hop" count is "-0-", we also insisted that the hexadecimal part exactly matched the contents of v2.54.0 tag, or when the "hop" count is not zero, we insisted that the hexadecimal part names a commit that is descendant of the commit v2.54.0 names.

Previous: Patrick SteinhardtNext: Jeff King
Message 3 of 4 in “Pinned references?”
  1. Erik ÖstlundJun 18, 2026
  2. Patrick SteinhardtJun 19, 2026
  3. Junio C HamanoJun 19, 2026
  4. Jeff KingJun 21, 2026

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.