samedi 21 novembre 2015

Git describe fails to return most recent annotated tag

I wrote a function that uses git annotated tags to create new releases and/or bump semver style version numbers for my project.

I am in the process of adding unit tests and noticed that git describe --abbrev=0 fails to retrieve the most recent tag, only when several git tag -a <tag> -m <msg> are run in a sequence.

I thought this has to do with these tags being created for the same commit, but I think that should not be the case for annotated tags.

Expected behavior:

git tag 1 -m v1
git tag 2 -m v2
git tag 3 -m v3
git describe --abbrev=0
3 

Reproduce problem:

git tag 1 -m v1; git tag 2 -m v2; git tag 3 -m v3
git describe --abbrev=0
1

Aucun commentaire:

Enregistrer un commentaire