-
Notifications
You must be signed in to change notification settings - Fork 652
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
Reported Versions Out of Order After Prerelease Tag #1844
Comments
Which version of GitVersion are you using? Are you able to reproduce the error in a
|
…fter a prerelease tag when not doing so would put them out of order
I'm using version 5.0.1+Branch.master.Sha.c71b8fc9f6d7b6adffe82fef588e717beb864e91 I've created a failing unit test that shows the issue. I put it in Should I submit a pull request with that code? |
A PR would be great. If you would dare attempt to figure out why GitVersion is acting up, that would be even better. 😃 |
Debugging the unit test in my PR #1845 to see why this is happening...
and then only increments the pre-release tag number if there is one: GitVersion/src/GitVersionCore/SemanticVersion.cs Lines 315 to 319 in 92c11a1
To me, that seems wrong. I asked it to increment the patch version and it didn't. Changing SemanticVersion.IncrementVersion() to not treat pre-release special, but to go ahead and increment (but possibly remove the pre-release tag) makes more sense. But doing that causes many more unit tests to break because the whole system depends on the current behavior.
I guess Is there any guidance you could offer on how to fix this? |
Yes, now that you're starting to dig into this, I remember this being a complicated hot mess. Perhaps @arturcic remembers when we discussed this last and what the result of that discussion was? My memory is not my strongest asset. 😅 |
Will the fix implemented in #2003 help with this problem in any way? |
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
With the following
GitVersion.yml
The table below shows 4 commits on the master branch, oldest to newest. The middle column indicates what tags have been created in git (
git tag something
). The third column shows the version GitVersion assigns to them.This all seems correct up until commit 4. Notice that according to SemVer 2.0.0 < 2.0.1-dev.1 < 2.1.0-rc, but 2.1.0-rc > 2.1.0-dev1.
After a release git tag, GitVersion increments the version number, but after a prerelease git tag, it doesn't. That makes some sense if
tag: ''
is set and the new version wil be-rc.X
, but doesn't make sense in this case.I think that if the branch tag setting would cause the current version to be before the previous tag, then the increment should happen.
The text was updated successfully, but these errors were encountered: