Comments (1)
I think the fix is actually straightforward: make an extra call to list tags at the same commit, and perform some semver-sorting on them and pick the latest one. So we'd do something like:
> git describe --long --tags --abbrev=8 --match $TagPattern --always --dirty=+${timestamp(d)}
0.1
> git tag --list --points-at 0.1
0.1
0.2
We can now infer that the "correct" tag is 0.2
, but use the commit distance and hash info from the original git describe
(by definition this is still valid, since we only search for other tags which point to the same commit).
I think this covers all use cases:
- for the above case (
HEAD
and multiple tags on the same commit) it works - if
HEAD
is ahead of the latest tag(s) it should still work -sbt-dynver
will produce something like0.2+1...
x <- HEAD
|
x <- 0.1, 0.2
|
o
- it should (I think) also work transparently with any mixture of annotated and lightweight tags, since again in each case we only consider a single commit (
points-at
) and pick the "highest" one
If you're happy with this, I'm happy to have a go at putting a PR together?
from sbt-dynver.
Related Issues (20)
- 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
- 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
- Task for printing out dynver for arbitrary commit
- Add setting/ability to use basic snapshot versioning with the hash.
- -rcX Tag suffix ignored HOT 1
- make behaviour configurable so that `previousStableVersion` can ignore M0/RC0 versions
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.