GitVersion
GitVersion copied to clipboard
[Bug] Merging remote main into main should count commits from both sources
Describe the bug With Mainline mode, I am able to create duplicate semver. I create N local commits. Somebody pushes N + 1 commits before I push mine. The merge commit from git pull will reuse the last semver.
Expected Behavior
GitVersion should recognize that it needs to count all commits from both variants of the same branch from the merge commit message, which would be something like "Merge branch 'main' of {remote}"
Actual Behavior
GitVersion treats the remote main as a non-mainline branch and increments using only the local N commits plus the merge commit.
Possible Fix
Use commit message to recognize sameness of remote and local branches.
Context
It causes my build to crash because of duplicate NuGet packages being generated.
Your Environment
Irrelevant. Will provide PR with failing test.
Does #2750 explain this sufficiently?
Sorry, forgot about this completely. I'm not sure I agree that this could not be fixed, but it's not the greatest deal. It's just an unsupported scenario where the solution is two-fold:
- Rebase merge if multiple people are committing to the same branch.
- Try to avoid that by using task branches instead of having multiple people on the same branch.
In short, we've improved our workflow to where this isn't hindering us. Hence, closing this.