Comments (8)
Yes, I'll be there! Sounds like a good bugfix for the SC Spree 😄
from sbt-dynver.
Interesting - I thought I'd checked this case, but clearly not, sorry.
You at Scala World, Olaf? Could see to fix it then (me/you/together).
from sbt-dynver.
Is there any progress on that issue ? Ideally we would like to have this fantastic plugin to choose the most recent tag. Or just the most recent version (v0.0.6 instead of v0.0.5 for instance) by simple string comparison maybe ?
from sbt-dynver.
I've not had a chance to look at this. Contributions welcome if they catch your fancy.
from sbt-dynver.
Might, do, any hint on where to look for the change to make @dwijnand @olafurpg ? I currently don't have the time for digging into the whole code without any starting point. Otherwhise it will have to wait
from sbt-dynver.
Everything comes from one invocation of git describe
: https://github.com/dwijnand/sbt-dynver/blob/v2.0.0/src/main/scala/sbtdynver/DynVerPlugin.scala#L121
Ideally there would be a flag for that that deals with this edge-case.
For testing (e.g to TDD your way to a solution) you could look to create a test similar to https://github.com/dwijnand/sbt-dynver/blob/v2.0.0/src/test/scala/sbtdynver/GH007.scala.
from sbt-dynver.
Hey @olafurpg,
I tried to reproduce this, but couldn't:
$ git init
Initialized empty Git repository in /s/t-git-multi-tag/.git/
$ echo 1 > f.txt
$ git add f.txt
$ git commit -m1
[master (root-commit) 6eda7fa] 1
1 file changed, 1 insertion(+)
create mode 100644 f.txt
$ git tag -a -s v2.0.0-RC3 -m 'Version 2.0.0-RC3'
$ git describe --tags --abbrev=8 --match v[0-9]* --always --dirty=+20180104-1200
v2.0.0-RC3
$ git tag -a -s v2.0.0 -m 'Version 2.0.0'
$ git describe --tags --abbrev=8 --match v[0-9]* --always --dirty=+20180104-1200
v2.0.0
Then I found this in the "SEARCH STRATEGY" section of git describe
:
Annotated tags will always be preferred over lightweight tags, and tags with newer dates will always be preferred over tags with older dates.
(https://www.kernel.org/pub/software/scm/git/docs/git-describe.html#_search_strategy)
Initially I thought that the problem was that my reproduction wasn't faithfully reproducing the tag dates.
Instead it looks like the issue is that the v2.0.0 tag of Scalameta is a lightweight tag, while v2.0.0-RC3 is a proper annotated tag:
$ git show v2.0.0-RC3
tag v2.0.0-RC3
Tagger: Ólafur Páll Geirsson <[email protected]>
Date: Wed Sep 6 11:49:04 2017 +0200
See #1109
commit 15a0187501dc8e5a6fe06d0e002ce1d3340968dc (tag: v2.0.0-RC3)
Merge: de1f4f2d5 10a2c60b0
Author: Ólafur Páll Geirsson <[email protected]>
Date: Wed Sep 6 11:46:47 2017 +0200
Merge pull request #1113 from olafurpg/ci-publish
Fix CI publish infrastructure
$ git show v2.0.0
commit fa0dc78783b5cb26b17ee32eec5536d36915c82e (tag: v2.0.0)
Merge: 15a018750 c89ad57d7
Author: Ólafur Páll Geirsson <[email protected]>
Date: Mon Sep 11 19:53:06 2017 +0200
Merge pull request #1118 from olafurpg/master
Redirect changelog files to GitHub releases.
I assume the tag was created with the GitHub Releases UI.
By default git describe
never considers lightweight tags, we actually opt-ed into lightweight tags specifically for GitHub's Releases UI (see #14) by adding the --tags
flag. Generally (IMHO) the difference isn't known by git users.
Unfortunately it doesn't look like there is a flag to make git describe
ignore the annotated vs lightweight tag difference and only consider the dates. And even then I'm not 100% sure if that would be a good idea.
Running out of ideas I'm going to close this, but please comment if you have any ideas or thoughts.
from sbt-dynver.
Interesting. Thanks for digging into this @dwijnand I did indeed publish v2.0.0 from the GitHub release UI and iirc I tagged v2.0.0-RC3 locally. I didn't know about lightweight vs. annotated tags.
Totally fine to close this issue then 👍
from sbt-dynver.
Related Issues (20)
- Ability to customise tag prefix HOT 2
- First parent appears to be wrong when commit has multiple parents HOT 4
- Avoid using `+` sign in artifact names by default HOT 3
- assertion failed: Incoherence: dynverTagPrefix=v vs dynverVTagPrefix=false HOT 3
- What is the best way to prepend a dependency version number in front of the version ? HOT 4
- Allow getting full Git commit hash HOT 1
- Better support for meaningful SemVer-compliant versions HOT 3
- Default version pattern leads to conflicting versions HOT 7
- Possible to use with sbt-native-packager?
- Move to sbt org? HOT 3
- Config to automatically increment to next major, minor or patch version HOT 7
- Can't override `isVersionStable`
- Breaks with SHA longer than 8
- Should this plugin only be enabled on CI environment? HOT 1
- Selects wrong version if multiple lightweight tags point to the same commit HOT 1
- Artefacts not available HOT 10
- Admin stuff HOT 2
- Release 5.0.0 HOT 2
- dynverAssertTagVersion throws NullPointerException
- Support peeking at remote history / tags? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-dynver.