version could be wrong when there are more than 1 tags on the commit
See original GitHub issuewhen there’s 1.9.0
and 1.10.0
as annotated tags for a commit, 1.9.0
will be returned (probably because it’s the first thing in a list thats sorted alphabetically). it should probably be sorted via semver and always return the larger version instead.
notice that this only happens because of the string “9” is greater than “1”. it’s fine on other versions
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
setuptools incorrectly picks tag between multiple lightweight ...
Assuming the current comment has multiple tags, setuptools only picks the first one, when it would be better to pick that last one...
Read more >git describe with two tags on the same commit - Stack Overflow
When I checkout the commit directly, it will be inherently ambiguous. ... Light weight tags appear to use the most recent version as...
Read more >When should a commit not be version tagged?
If your version control model happens to require that every commit to master be a release, then yes, every commit will need to...
Read more >Repository Tag task tagging the wrong commit
Hi folks, I am currently working on automated release creation using Bitbucket and Bamboo. Unfortunately the tagging creates some headaches The setup.
Read more >Better display of tags in commits list view - GitLab.org
And possibly showing more than just one of each before collapsing the rest into ... If there were lots of tags on lots...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am running up against this issue as well. And have created https://github.com/palantir/gradle-git-version/pull/103?w=1
If I have 3 subprojects which are versioned independently, I want to ensure my projects keep track of their own versions.
So, given the following git log:
When I run
printVersion
for my 3 subprojects, I currently do not get the correct results:Actual
Expected
By moving the prefix filtering logic to
mapCommitsToTags
, we can acheive the desired result.I have done some testing and the behaviors of JGit and ‘git describe’ are actually different: one return the first tag and one return the last, but none guarantee that it’s the latest version. So it’s actually not returning what ‘git describe --tags’ would return anyways. I think it would be more useful to support returning the latest version instead of random alph-sorted result.
Thanks, Sixin