VersionIncrement related cleanup #1777
Copy link
Copy link
Open
Labels
Description
Description
- Replace ['MAJOR', 'MINOR', 'PATCH'] with
IntEnumsfeat(version): add MANUAL_VERSION, --next and --patch to version command #1724 - Remove
find_increment
Possible Solution
No response
Additional context
No response
Related issues
No response
Reactions are currently unavailable
Activity
Lee-W commentedon Jan 6, 2026
Why do we need to do it?
bearomorphism commentedon Jan 7, 2026
Commitizen often has to determine which Increment is actually using. For example,
commitizen/commitizen/bump.py
Line 53 in d1f8bf0
But comparing the index is a bit unclear and hard to maintain.
I have implemented it in #1518 a few months ago (but now there are too many conflicts, so I'd prefer to start over and probably split it into several smaller PRs). The function
find_incrementscan be redesigned in a way clearer way:VersionIncrement, so we have a collection ofVersionIncrementsThe implementation of
VersionIncrementcan be found in #1724.bearomorphism commentedon May 9, 2026
Replacing the
MAJOR/MINOR/PATCHstring constants incommitizen/defaults.pyandcommitizen/bump.pywith the existingVersionIncrementIntEnum atcommitizen/version_increment.pyis a cross-cutting refactor (bump.py,commands/bump.py,commands/version.py,cli.py, plus the entire test suite that compares against literal strings). It's also a breaking change for any external code that importsMAJOR/MINOR/PATCHand compares with==.Best done as part of the v5 cleanup so the deprecation doesn't have to span a 4.x release. Surfaced via the round-2 triage in #1965 — proposing this be tracked under #1481 (v5).