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

Re: Fw: git describe issue

From
Bryan Turner <bturner@atlassian.com>
Date
Apr 3, 2019, 08:11 UTC
Message-ID
<CAGyf7-GcrWX-TRP89a1SqKu4h74Mbezq0ifHpS305epfmKxJvw@mail.gmail.com>
In-Reply-To
<AM6PR08MB4199EE3834CBF84D28244D9E8D570@AM6PR08MB4199.eurprd08.prod.outlook.com>
On Wed, Apr 3, 2019 at 1:00 AM Amiel Elboim <amielel@matrix.co.il> wrote:
>
> Very helpful!  annotated tag is good solution for us.
>
> However fix of this issue is important, because it's confusing when you want to track on your version using git tags.

Lightweight tags have no metadata to allow for ordering, so I'm not sure there's something to "fix" here. Given the tags have identical timestamps, Git simply displays the one that's first alphabetically.

Git does have some ability to parse versions and sort them, on newer versions, but there's no way to activate that via "git describe --tags", at least as far as I'm aware (and I'm not sure how reliable it can be, given tag names are essentially free-form text).

You can try Git's version sorting with a command like "git tag --sort=-v:refname" (The "-" before "v:refname" sorts in descending order)

incom@Jael MINGW64 /c/Temp/fourth.git (BARE:master) $ git tag v1 v2 incom@Jael MINGW64 /c/Temp/fourth.git (BARE:master) $ git tag --sort=-v:refname v2 v1

Since you can't enable that for "git describe --tags", though, I'm not sure it's helpful. (Someone else can correct me if there is a way to make "git describe" do that.)

Bryan
(Re-added the list on CC)
Previous: Bryan TurnerNext: Philip Oakley
Message 3 of 4 in “Fw: git describe issue”
  1. Amiel ElboimApr 3, 2019
  2. Bryan TurnerApr 3, 2019
  3. Bryan TurnerApr 3, 2019
  4. Philip OakleyApr 3, 2019

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.