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

RE: [BUG] `git describe` doesn't traverse the graph in topological order

From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
Date
Sep 22, 2023, 18:12 UTC
Message-ID
<032d01d9ed80$5e569670$1b03c350$@nexbridge.com>
In-Reply-To
<xmqqediq2j0g.fsf@gitster.g>
On Friday, September 22, 2023 1:52 PM, Junio C Hamano wrote:
><rsbecker@nexbridge.com> writes:
>
>> There appears to be a merge at 446120fd88 which brings v9.3.0.rc0 closer
to HEAD
Show 5 quoted lines
>than v9.3.0.rc1.
>
>I didn't look at the actual graph but let me say I trust you ;-)
>
>I wonder if there should be an obvious "explain why you gave this name"
mode added
>to the command, though.  The command should be able to say "The closest
path from
>HEAD to any tag is via this, that, and that commit, which is N hops to tag
T0", and
>from there, the user should be able to say "Oh, I thought T1 was closer,
let me try
>again to describe HEAD, limiting the candidate only to T1" and run the
command in
>that mode, which should be able to say "The closest path from HEAD to any
tag that
>is allowed as a candidate is via these commits, which is M hops to tag T1".
And if M
>is smaller than N, then that may deserve to trigger a bug report (but as
you said,
>there are rules like preferring annotated over unannotated tags involved,
so it may
>not as straight-forward as comparing the two integer hop counts).
>
>Thanks for digging.

I'm wondering whether we need something more general that --first-parent. Perhaps something like

git describe commitish [ commitish ... ]

Where the traversal must cross the set of specified commitish points in history in order to find the expected tag. In Ben's case, I do not think that would help much, given the complexity of his history. Perhaps a --verbose argument might display the analysis path done by git describe as above. Sadly, I am not familiar with this code area.

What confuses me is how, in the other subthread, that adding sleep 1 to the construction of history should make any difference. My understanding is that the path to the tag is invariant of the commit-date.

Previous: Junio C HamanoNext: 'Ben Boeckel'
Message 8 of 20 in “[BUG] `git describe` doesn't traverse the graph in topological order”
  1. Ben BoeckelAug 12, 2023
  2. Ben BoeckelSep 22, 2023
  3. rsbecker@nexbridge.comSep 22, 2023
  4. 'Ben Boeckel'Sep 22, 2023
  5. rsbecker@nexbridge.comSep 22, 2023
  6. 'Ben Boeckel'Sep 22, 2023
  7. Junio C HamanoSep 22, 2023
  8. rsbecker@nexbridge.comSep 22, 2023
  9. 'Ben Boeckel'Sep 22, 2023
  10. rsbecker@nexbridge.comSep 22, 2023
  11. 'Ben Boeckel'Sep 22, 2023
  12. rsbecker@nexbridge.comSep 22, 2023
  13. 'Ben Boeckel'Nov 20, 2025
  14. Jeff KingNov 20, 2025
  15. 'Ben Boeckel'Feb 28, 2026
  16. 'Ben Boeckel'Sep 22, 2023
  17. 'Ben Boeckel'Sep 23, 2023
  18. Kristoffer HaugsbakkSep 22, 2023
  19. Kristoffer HaugsbakkSep 22, 2023
  20. 'Ben Boeckel'Sep 22, 2023

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.