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, 17:14 UTC
Message-ID
<02e701d9ed78$436b3c60$ca41b520$@nexbridge.com>
In-Reply-To
<ZQ3GAJ/AHsM9e9a6@farprobe>
On Friday, September 22, 2023 12:51 PM, Ben Boeckel wrote:
Show 15 quoted lines
>On Fri, Sep 22, 2023 at 12:13:00 -0400, rsbecker@nexbridge.com wrote:
>> On Friday, September 22, 2023 11:40 AM, Ben Boeckel wrote:
>> >On Sat, Aug 12, 2023 at 15:36:56 -0400, Ben Boeckel wrote:
>> >> I found an issue where `git describe` doesn't find a "closer" tag
>> >> than another tag as the correct one to base the description off of.
>> >> I have a reproducer, but I'll first give details of the real world issue.
>> >
>> >Bump. Can anyone provide guidance as to what the best solution to this might be?
>>
>> Can you provide details? `git describe` is sensitive to --first-parent
>> and whether the tag has annotations.
>
>I provided more details and a reproducer in the original email:
>
>    https://lore.kernel.org/git/ZNffWAgldUZdpQcr@farprobe/T/#u
As I indicated, the command is sensitive to --first-parent. For example:

$ git describe v9.3.0.rc0-520-g1339e86833 $ git describe --first-parent v9.0.0.rc1-5143-g1339e86833

You have multiple parents in your tree of HEAD. This is probably confusing the interpretation. The most closely connected tag to HEAD is v9.3.0.rc0, from what I can read from your tree. Dates and times of the commit do not participate in this determination, to my knowledge. You can force selection of a subset of tags by specifying the --match=pattern argument.
There appears to be a merge at 446120fd88 which brings v9.3.0.rc0 closer to HEAD than v9.3.0.rc1.
Previous: 'Ben Boeckel'Next: 'Ben Boeckel'
Message 5 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.