We've recently decided to change our internal version numbering for a large (50K commits) repo from a year-based number to a more traditional version number. As such, we've replaced all our existing tags numbered like 2015.x.y to 7.x.y. Unfortunately, GitVersion 3.6.1 still tries to extract information from the merge commits that happened somewhere in the history of the repo. For example, it decides the base-version to be 2015.5.1 using this commit message:
Base version used: Merge message 'Merge branch 'Development/2015.05.01' into 576446_Client_Reports': 2015.5.1 with commit count source 4ec2b7c3c6270b3ebd14e7ccf7dbfd84512bf945
We've tried to tweak the global commit-message-incrementing setting or the branch-specific prevent-increment-of-merged-branch-version and track-merge-target, but neither is doing the trick. Is this a bug or am I doing something wrong?
Since version 3.5.3 GitVersion supports ignoring individual commits for calculating the version. See #851 as how it is implemented. Does this help in your situation?
It does work, but since we have a 5-year old repo with 50-100 developers, there are simply too many commits to ignore...
@dennisdoomen what about the configuration option to:
commits-before: 2015-10-23T12:23:15
i.e. don't ignore individual commit sha's (that would be a lot) but rather, ignore all commits before this date, and start your versioning strategy again?
what about the configuration option to:
Is this supported on 3.6.1? I'm getting a _Property 'commits-before' not found on type 'GitVersion.Config'_
@dennisdoomen I certainly thought it was. @JakeGinnivan @pascalberger can you confirm?
It is certainly included in the documentation: http://gitversion.readthedocs.io/en/latest/configuration/
I also though it should be. There's also a test available here. But never used it myself.
Ah, that helps. I treated it as a top-level global setting.
@dennisdoomen let us know how you get on. It also isn't something that I have used before, as I haven't needed it, but I have heard of people making use of it.
Yep, the commits-before trick is solving the problem. Still wondering how the other options are supposed to work though.
@dennisdoomen said...
Still wondering how the other options are supposed to work though.
Sorry, can you explain what you mean? Which other options are you referring to?
We've tried to tweak the global commit-message-incrementing setting or the branch-specific prevent-increment-of-merged-branch-version and track-merge-target, but neither is doing the trick. Is this a bug or am I doing something wrong?
These...
@dennisdoomen gotcha...
Is this a public repo that you can share? If so, someone might be able to help you with the required configuration, or to point out why these won't work for your needs.
commit-message-incrementing works on +semver: major style commit messages. Not merge messages.
prevent-increment-of-merged-branch-version - This setting will still inherit the version from the merge message, it effects if gitversion then increments the version number. i.e merge _release/2.0.0_ into a branch with this setting true and it will end up as 2.0.1 or 2.1.0 (depending on the increment setting). If it's false it will calculate 2.0.0.
track-merge-target - I think this needs to be killed in v4, but the idea is that if a release branch is merged to master then it will cause develop to bump. I have always found this setting really confusing (I know the others are too, but hard to model this stuff..).
Basically, there is no way to turn off merge messages. It would be pretty easy to turn off by introducing a enable-version-from-merge-message or something, then just turn off https://github.com/GitTools/GitVersion/blob/master/src/GitVersionCore/VersionCalculation/BaseVersionCalculators/MergeMessageBaseVersionStrategy.cs
@JakeGinnivan said...
Basically, there is no way to turn off merge messages. It would be pretty easy to turn off by introducing a enable-version-from-merge-message or something, then just turn off https://github.com/GitTools/GitVersion/blob/master/src/GitVersionCore/VersionCalculation/BaseVersionCalculators/MergeMessageBaseVersionStrategy.cs
I think that would be very useful. I think we should be able to enable/disable all the strategy's.
Good idea, lets do that for v4. Anyone want to put together an up for grabs issue.
Maybe something like
strategies:
- merge-message: false
Other ideas?
Is this a public repo that you can share? If so, someone might be able to help you with the required configuration, or to point out why these won't work for your needs.
You know the answer, don't you :trollface:
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.
Most helpful comment
Good idea, lets do that for v4. Anyone want to put together an up for grabs issue.
Maybe something like
Other ideas?