Reputation: 51
We have following branch setup:
The expectation is that both branches produce "stable" versions so there're no prerelease tags.
When running GitVersion on these branches, the release branch produces version 1.0.3 and master branch produces version 2.0.1. So far so good, this is what we expected.
Now one of our colleagues created a new feature branch from the release branch, which they then merge master into afterwards. The feature branch was then merged back into the release branch with a pull request. After the completing the pull request, GitVersion now gives 2.0.X on the release branch, instead of 1.0.X.
To try and fix the issue, we tagged the release branch with 1.0.4. However, with every new commit into release branch, the problem comes back. This forces use to manually tag every commit into release branch to give us our desired version number.
We're using GitVersion 4.0.0-beta0014 in mainline mode.
The config looks like:
mode: mainline
assembly-versioning-scheme: MajorMinorPatch
continuous-delivery-fallback-tag: ''
commit-message-incrementing: Disabled
branches:
master:
tag: ''
feature:
regex: features?[/-]
tag: unstable.{BranchName}
release:
tag: ''
is-mainline: true
bugfix:
regex: bugfix[/-]
tag: unstable.{BranchName}
ignore:
sha: []
Anybody any idea how to get out of this?
Lubos
Upvotes: 0
Views: 1174
Reputation: 778
I think you're looking for the "prevent merge branch increment option" - there's some documentation on it here:
https://gitversion.net/docs/configuration#prevent-increment-of-merged-branch-version
basically you just set it to true in your gitversion.yml like below:
mode: mainline
assembly-versioning-scheme: MajorMinorPatch
continuous-delivery-fallback-tag: ''
commit-message-incrementing: Disabled
branches:
master:
tag: ''
feature:
regex: features?[/-]
tag: unstable.{BranchName}
release:
tag: ''
is-mainline: true
bugfix:
regex: bugfix[/-]
tag: unstable.{BranchName}
ignore:
sha: []
prevent-increment-of-merged-branch-version: true
Upvotes: 1