-
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
Hotfix resets PreReleaseTag.Number to 1 #465
Comments
Would you have time to look into this, or at least create a failing test? I am short on time at the moment (moving back to Australia in two weeks). |
Behaviour with the default config of the latest GitVersion:
This is because the commits are counted since the hotfix merge commit due to the
But I have no idea what to do with that information :) Should BaseVersionStrategies be configureable in some way? Should I avoid using a version in my hotfix branch name? Does the merge message strategy need to be adjusted? Is the |
I just discovered the But this leads to multiple different releases of e.g. |
Ok, so I have partially fixed the problem, now am not sure where to go (I can sort the implementation, but I just cannot figure out the rules..). Lets take this commit graph:
We are trying to calculate the version from Both 1.2.0 get incremented to 1.3.0 and both are 1 commit away from the Tip of develop, so we get the same version. Maybe I could do something like when I see a merge commit source I take the first parents source. Interesting issue :( |
I thought maybe instead of simply finding the highest baseversion, find the highest baseversion with the lowest patch value, if we are on a branch that has the increment strategy set to minor. But that did break some tests and I stopped there. |
That could work if you also check the |
I think the logic for finding the base version is correct. What is incorrect is picking the source for commit counting. If we separate those two things then this might become easier. The road I was heading down is just leading to pain, I am going to stash that and try again later |
And the logic for commit counting should be something along the lines of:
Thoughts? |
…ld produce the same version This fixes GitTools#465
Fixes version calculation issue introduced when fixing #465
From the gitflow examples:
develop
might've been at1.3.0-unstable.2
before the hotfix, but as soon as the hotfix is merged, GitVersion resets the number to1.3.0-unstable.1
.We build NuGet packages off of our develop branch (e.g.
1.3.0-unstable0002
) and if the counter resets, people won't get any updates.Edit: using ContinuousDeployment on develop
The text was updated successfully, but these errors were encountered: