Web lists-archives.com

Re: Fw: git describe issue

On 03/04/2019 09:11, Bryan Turner wrote:
On Wed, Apr 3, 2019 at 1:00 AM Amiel Elboim <amielel@xxxxxxxxxxxx> 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.
wouldn't the 'fix'  be to the documentation that Amiel quoted to clarify that 'annotated tags' can be date sorted but lightweight tags can't.

Maybe Amiel could suggest a short documentation patch to that effect that would have helped as a new reader of that doc. In this case it's the omission that is easily missed.

  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

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

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.)


(Re-added the list on CC)