-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple labeled tags leads to NumberFormatException during project load #192
Comments
For the next person that hits this. It looks to be caused by Which looks to be fixed in the 2.0 version You can get around it in 1.x by relying on git describe versioning and disabling tag versioning by filtering all tags: git.useGitDescribe := true
git.gitDescribePatterns := Seq("v[0-9]*")
git.gitTagToVersionNumber := { _: String => None } |
Dang. I just now discovered that that omits dropping the v-prefix. So it looks 2.0 is a better way forward. |
Ok, I found a similar but not the same problem that bubbles up in a multi tag context. https://github.com/sbt/sbt-git/blob/v2.0.0/src/main/scala/com/github/sbt/git/GitPlugin.scala#L275 If this needs to sort x.y.z-alpha-1, you also get a number format exception. As with the previous problem, it only surfaces if you have multiple results that need sorting. |
In case of multiple tags on HEAD, if any of them is labeled, then a NumberFormatException is thrown and project can't be loaded.
For example, let's say I have
v1.0.0
andv1.0.1-alpha
, an exception like the one below is thrown:From what I could check it's related to #162 and the fact that
versionsort.VersionHelper
expects tags to strictly follow a pattern like\d(\.\d)+
failing otherwise.Affected version: 1.0.1.
In order to support projects using different tagging patterns would it be possible to make the tag ordering configurable or disable it altogether?
Ps.: I would be willing to contribute.
The text was updated successfully, but these errors were encountered: