You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MAJOR,MINOR,PATCH config that takes in consideration the branch #1572
First of all, thank you for this program. I really enjoy using it.
I looked for a way to perform what I need but I was not able to find the necessary information, therefore I suspect this is not something possible at the moment, ence, the feature request.
I am currently using commitizen on projects in which:
main branch accept only major and minor
release branches that accept only patch (no breaking changes are allwed during patch fixes)
At the moment this is handled manually, the user needs to check which version will be issued and manually specify the version or correctly manage the commit name in order to obtain the right next-value.
problem is I won't trust who is performing the tag to make the correct tag. I would like to have it automated and enforced at configuration level.
Thank you for reading.
Hope this could be something interesting
Possible Solution
I would like to be able to write in the config file something like:
This will allow to cherry pick a fix and perform the bump without editing the commit message, or without specify the wanted increment on the command line.
This is an architectural feature ask: branch-aware bump rules. There are three open design questions a maintainer needs to call before any PR makes sense:
Configuration shape. Is the rule per-branch ([tool.commitizen.branches.main], [tool.commitizen.branches."release/*"]) or a list of { pattern, max_increment, min_increment } rows? The latter scales better but is more verbose.
Detection of "current branch".cz bump is sometimes invoked from CI in a detached-HEAD state (after a PR merge). Do branch rules apply by git rev-parse --abbrev-ref HEAD, by the GitHub Actions GITHUB_REF, by an explicit --branch flag, or by all three with priority?
Interaction with --increment / --prerelease. If the user passes --increment MAJOR but the branch rule caps at MINOR, do we error or downgrade?
Until these are decided, any PR is going to need a redesign. Surfacing via the round-2 triage in #1965 — flagging that this is a maintainer-design item rather than an implementation-ready one.
Activity
bearomorphism commentedon May 9, 2026
This is an architectural feature ask: branch-aware bump rules. There are three open design questions a maintainer needs to call before any PR makes sense:
[tool.commitizen.branches.main],[tool.commitizen.branches."release/*"]) or a list of{ pattern, max_increment, min_increment }rows? The latter scales better but is more verbose.cz bumpis sometimes invoked from CI in a detached-HEAD state (after a PR merge). Do branch rules apply bygit rev-parse --abbrev-ref HEAD, by the GitHub ActionsGITHUB_REF, by an explicit--branchflag, or by all three with priority?--increment/--prerelease. If the user passes--increment MAJORbut the branch rule caps atMINOR, do we error or downgrade?Until these are decided, any PR is going to need a redesign. Surfacing via the round-2 triage in #1965 — flagging that this is a maintainer-design item rather than an implementation-ready one.