`+semver: patch` and `+semver: fix` bump Minor version instead of Patch
See original GitHub issueDescribe the bug
+semver: patch
and +semver: fix
bump Minor version instead of Patch.
Expected Behavior
When entering a commit message of +semver: patch
or +semver: fix
, I expect the Patch digit of the version to be bumped.
Actual Behavior
When entering a commit message of +semver: patch
or +semver: fix
, the Minor version is being bumped, and the Patch version reset to 0.
Possible Fix
no idea
Steps to Reproduce
- Start with a
develop
branch with a git tag2.0.1
. - Set
commit-message-incrementing: Enabled
in GitVersion.yml. - Make a commit directly to
develop
, with+semver: patch
or+semver: fix
in the commit message. - Inspect the generated versions.
Context
Running Gitversion in a Jenkins pipeline, trying to implement a standardized versioning scheme for my group/whole org, with as little manual involvement as possible.
Your Environment
Jenkins 2.277 Powershell 7 Windows Server 2012 R2 (on VMware) Gitversion 5.6.11+Branch.main.Sha.1680a89918cb1b3b15cd37ccf78079e1fc3bfdff git version 2.8.2.windows.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Guidance on rectifying a minor bump that should have ...
... to Semantic Versioning 2.0.0 would suggest that you are OK with just bump the minor version. Given a version number MAJOR.MINOR.PATCH ......
Read more >Reason for MINOR vs PATCH rules in SemVer
EDIT: It is a best practice to separate bug fixes (patches) from feature work (minor) and breaking changes (major), into separate releases.
Read more >Semantic Versioning 2.0.0 | Semantic Versioning
PATCH version when you make backward compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR....
Read more >Semver doesn't mean major.minor.patch, it means fails. ...
I've been broken by every level of version bump. ... list all API changes, and it will tell you which changes are minor,...
Read more >Version Incrementing
Semantic Versioning is all about releases, not commits or builds. ... +semver: minor will bump minor and +semver: patch or +semver: fix will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you @BinToss - I did post that same link in my request for more docs; some of them are detailed, some are not. I was on the receiving end of unintentionally-hurtful comments about documentation recently, so I didn’t mean for mine to be the same; but there is a lot of figuring it out on one’s own required here, so some more examples would be great.
I did eventually figure out that i was expecting a
mainline
style of operation, not either of thecontinuous
modes. My current config looks like this:As you can see I also added some additional tokens to the auto-bump messages. I’m also having an issue with Release branches adding the metadata info to the tag; it’s an extended use case like this that i’m having trouble finding specific help for in the docs.
All of that being said, I believe this can be closed.
https://gitversion.net/docs/reference/configuration#increment-1 https://gitversion.net/docs/reference/configuration#prevent-increment-of-merged-branch-version https://gitversion.net/docs/reference/configuration#track-merge-target https://gitversion.net/docs/reference/configuration#regex https://gitversion.net/docs/reference/configuration#source-branches https://gitversion.net/docs/reference/configuration#tracks-release-branches https://gitversion.net/docs/reference/configuration#is-release-branch https://gitversion.net/docs/reference/configuration#is-mainline https://gitversion.net/docs/reference/configuration#pre-release-weight https://gitversion.net/docs/reference/configuration#track-merge-target
Regarding the original issue…
Possible Fix
gitversion -verbosity Diagnostic -diag
should output info to help determine why the version is or isn’t being incremented.If the version is incremented because of commits’ messages matching the message regex, then display which part of the version was bumped with the regex pattern that matched the commit for each discovered commit. Assuming the last version was 1.0.0, two commits match
minor-version-bump-message: "^(feat)(\\([\\w\\s]*\\))?:"
and one matchespatch-version-bump-message: "^(fix|perf)(\\([\\w\\s]*\\))?:"
, then output:I’d also run into the issue of the expected version being 1.0.3 given three patch commits after a
v1.0.0
commit, but gitversion was determining the develop version to be 1.1.0 or 1.0.8 depending on themode
that was set. I’d eventually gotten that sorted out after resetting main to develop and force pushing main.