Describe the bug
When calculating the version, the sha-commits specified in the settings (GitVersion.yml) in [ignore: sha] section are not taken for calculate base version.
Found on version 5.3.7.
Version 5.3.1 gives a good result.
Version changes when using [ignore] in config.
Version not changes when using [ignore] in config.
Hi. As described in https://github.com/GitTools/GitVersion/issues/2122#issuecomment-642900931, ignore only ignores the commits for base version sourcing, not for version calculation. Adding this information to the documentation would be a welcome PR.
@asbjornu thanks. How can I now ignore commits to calculate the version as previouse version GitVersion (aka 5.3.1)? This functionality is no longer supported?
So, you're saying this worked as you expect in 5.3.1 but has since regressed? It would be interesting to find what the change since then was. From a quick inspection of the milestones, I can't find anything obvious.
Yes, this worked great on 5.3.1. Further I have only 5.3.7 where the problem is reproduced. I will investigate the problem in more detail and give reasons. I need some time.
Found in commit
return DefaultConfigProvider.CreateDefaultConfig()
.Apply(configFileLocator.ReadConfig(workingDirectory))
.Apply(overrideConfig ?? new Config())
.FinalizeConfig();
When configuring GitVersion.Model.Configuration.Config, its Ignore property is set 1 time from the config source file and again from the empty config (new Config()) and thereby overwrites the settings.
Maybe this is the reason?
@elmanav, right. That makes sense. That was changed in #2300 which was released in version 5.3.6. In that case, this is a bug that should be fixed.
Since you've already dug through the code, would you be up for providing a PR to fix this, but perhaps most importantly a test that first verifies the bug that goes successful after the fix is implemented? 馃檹
No problems. I will try to figure out the details and fix this problem (if possible). And the test will also be.
I'm trying to apply GitVersion (command-line) to a long-lived repo.
The ignore section has no effect for me, with neither 5.3.5 (/showConfig displays the ignored sha) nor 5.3.7 (/showConfig displays empty ignore list).
My repo has an old commit which for some weird reason is used as the source of version "2015" - from the commit message maybe ("use Lagoon2015; Ocean2015")?
Because of this large version number source (which can't be ignore'd), I'm unable to reset to my desired version (2.0.5) - neither with GitVersion.yml nor a tag.
(I applaud the vision for this tool, but getting it to work, and diagnosing why it doesn't, is incredibly difficult!)
Edit: I now found the "ignore.commits-before" option, which ignores everything I want. It appears VersionSourceSha was "hiding" some an even older merge-from-release-branch commit which acted as the undesired source.
Edit 2: GitVersion 5.3.7 also clears "commits-before" - I'll revert to 5.3.5 for the time being.
This should be resolved in master. See #2412.
Fixed by #2429
:tada: This issue has been resolved in version 5.5.0 :tada:
The release is available on:
Your GitReleaseManager bot :package::rocket:
Most helpful comment
No problems. I will try to figure out the details and fix this problem (if possible). And the test will also be.