-
Notifications
You must be signed in to change notification settings - Fork 653
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
[Bug] GitVersion calculates the wrong version after main
is merged back to develop
#3699
Comments
I'm not sure if it is a bug or feature. Anyway I see your use case. When merging from master to develop why not just do a rebase? |
Thank you for your reply! Interesting option with rebasing, but we would prefer not to rewrite the history of our develop branch. Is there any other option built-into GitVersion that we might be able to use? |
Hi @HHobeck . Do you mean rebase of In addition to this rebasing of develop over master would be a painful process because of conflicts (that we would have to fix with the help of people that did the changes).. This release strategy is a variation of |
From the git flow point of view I would always recommend to make a rebase from develop to any feature branches. Merging from develop to the release branch you can run into problems as well (see the discussion #3177). The reason is to get a cleaner history and of course not run in this problems you are facing here. At the end if you as a developer are creating a new feature you always do it on a history base like e.g. develop branch. If you are done the development one this basis instantly or with merging it x times it makes no difference and also no one cares. It gives no additional information to you or other developers. At the end we talking about how difficult it is to merge changes with rebase or with normal merge strategy. And here I'm not certain if I can sign your statement that the merge conflicts are more complex to solve in case of rebasing. An alternative solution like you already pointed out would be to always merge the changes from the hotfix to develop branch sure. |
I want to point out that also having direct commits on develop branch with bump messages is very unusal. Normally the motiviation using bump message is directed in the scope of the feature development (see this comment #2958 (comment)). And if you do a rebase from develop to feature branch then you are fine. That' means you can do a merge from main to develop with merge message as long you are consider this workflow. |
Sorry for a long delay - we've been busy with some other stuff..
I'm not sure I understand you correctly. The original GitFlow is actually merge-base solution, but that's regarding the feature branches. As for develop branch - it must be protected in GitFlow (and, actually, in most/all git strategies).
We don't merge develop to release branch. But we need to up-merge hot-fixes to develop. This is the scenario where we have issues now.
Oh yeah, we also like to have a cleaner history, and simple process. That's why we optimized the GitFlow strategy to our needs. But conceptually it's still very close to GitFlow.
That's correct
Well, when you rebase a branch, you need to take care of each commit in that branch. And the bigger the branch is, the more difficult it may be. Especially, if something was moved/refactored back and forth.
I think the issue here is that if you're merging 2 branches, and one of them has tags, while another - doesn't -> gitversion completely ignores the other branch. We tested a work-around: we decided to manually tag the branch with the But we would love to have an option in Kind regards, |
@HHobeck isn't the merged PR fixing the problem? |
I think we need to revert it. The fix is not right unfortunately. |
both commits? or only the last one? |
I mean these commits https://github.com/GitTools/GitVersion/pull/3927/commits |
Only this one needs to be reverted: a0c170b |
done |
🎉 This issue has been resolved in version 6.0.0-beta.6 🎉 Your GitReleaseManager bot 📦🚀 |
Describe the bug
Our config file looks like this:
Imagine that we have the following tree:
When I run
dotnet-gitversion | jq '.FullSemVer'
ondevelop
, I get the correct version:2.0.0-alpha.1
But after I merge
main
todevelop
, I get the wrong version calculated:1.1.0-alpha.3
Expected Behavior
I expect gitversion to respect commits from
develop
branch and calculate version2.0.0-apha.X
Actual Behavior
Commits from
develop
are ignored, gitversion calculates the version from the last tag, which in this case is in the "sub-branch" ofdevelop
Context
We have to apply an empty
+semver:major
commit every timemain
is merged back todevelop
.Your Environment
5.12
, and6.0.0-bet.3
The text was updated successfully, but these errors were encountered: