-
Notifications
You must be signed in to change notification settings - Fork 654
Enable config based ignoring of commits/messages that incorrectly inc… #470
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
Enable config based ignoring of commits/messages that incorrectly inc… #470
Conversation
…rement version The latest changes to the MergeMessage branching strategy, while very helpful, have pulled in very old messages from our repo that are formatted in a way that cause the version number to be unexpectedly high. This changes allows configuration of commit SHAs to ignore, or strings to ignore inside merge messages, so you can "fix" old commits in your repo that you don't want to effect the version generation. This is related to GitTools#466 and a possible fix for GitTools#443
@@ -42,6 +42,16 @@ private static SemanticVersion Inner(Commit mergeCommit, EffectiveConfiguration | |||
return null; | |||
} | |||
|
|||
if (configuration.CommitsToIgnore != null && configuration.CommitsToIgnore.Contains(mergeCommit.Sha)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should do something a little more generic, what about bad tags or other things? Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought on tags specifically is that it's pretty easy to delete/fix a bad tag, but fixing a bad commit/message from way back in the repo is nigh on impossible.
As to the larger point, how do you think that would be accomplished? Just have a ThingsToIgnore
collection and just do
if(mergeCommit.Sha.In(ThingsToIgnore) || mergeCommit.Tag.In(ThingsToIgnore) || ... etc. etc.)
?
I'm not super familiar w/ how the Commit
object works, so there might be a better way than that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. Leave me with this, want to think it through before I put it in the config (cause then we are stuck with it).
I will merge this before the next release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
I am wondering if we should add something to the
Recon it's worth it? |
I can help out with the |
I have been thinking about this. I think we should just have Then in https://github.com/GitTools/GitVersion/blob/release/3.0.0/GitVersionCore/VersionCalculation/BaseVersionCalculator.cs#L24 add another |
I'm not opposed to that, although I do have 2 caveats:
|
And I'm definitely all for doing something w/ the |
Beta 4 has much better logs so it lists everything you would need. Also the init configuration could have an option to exclude commits which are causing incorrect version bumps, one option could be to exclude commits with commit message. So config is simple and init has the options? Sent from my Windows Phone From: Chris Maffinmailto:[email protected] I'm not opposed to that, although I do have 2 caveats:
— |
I just faced this while trying to add GitVersion to an existing repo with a |
Ignore before a time would be better than a sha, otherwise it needs another scan of the repo to find all sha's which are before a specific sha. At least specific shas are a simple equality check. |
👍 for ignore before a time. |
Time works for me as well |
Some sort of |
…rement version
The latest changes to the MergeMessage branching strategy, while very
helpful, have pulled in very old messages from our repo that are
formatted in a way that cause the version number to be unexpectedly
high.
This changes allows configuration of commit SHAs to ignore, or strings
to ignore inside merge messages, so you can "fix" old commits in your
repo that you don't want to effect the version generation.
This is related to #466 and a possible fix for #443