Skip to content

Commit 1b4d492

Browse files
committed
chore: merge master into fm/commitizen-doc-example-checks
# Conflicts: # commitizen/bump.py # commitizen/commands/bump.py # tests/test_bump_find_increment.py
2 parents 2eb168e + f565e81 commit 1b4d492

13 files changed

Lines changed: 17 additions & 69 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ repos:
5656
- tomli
5757

5858
- repo: https://github.com/commitizen-tools/commitizen
59-
rev: v4.19.0 # automatically updated by Commitizen
59+
rev: v4.19.1 # automatically updated by Commitizen
6060
hooks:
6161
- id: commitizen
6262
- id: commitizen-branch

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v4.19.1 (2026-10-03)
2+
3+
### Refactor
4+
5+
- **bump**: use VersionIncrement ordering for bump detection (#2097)
6+
17
## v4.19.0 (2026-09-22)
28

39
### Feat

‎commitizen/__version__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.19.0"
1+
__version__ = "4.19.1"

‎commitizen/bump.py‎

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,16 @@
44
import re
55
from glob import iglob
66
from string import Template
7-
from typing import TYPE_CHECKING, cast
7+
from typing import TYPE_CHECKING
88

99
from commitizen.defaults import BUMP_MESSAGE
1010
from commitizen.exceptions import CurrentVersionNotFoundError
1111
from commitizen.git import smart_open
12-
from commitizen.version_increment import VersionIncrement
1312

1413
if TYPE_CHECKING:
15-
from collections.abc import Generator, Iterable, Mapping
14+
from collections.abc import Generator, Iterable
1615

17-
from commitizen.git import GitCommit
18-
from commitizen.version_schemes import Increment, VersionProtocol
19-
20-
21-
def find_increment(
22-
commits: list[GitCommit], regex: str, increments_map: Mapping[str, object]
23-
) -> Increment | None:
24-
"""Preserve the legacy bump helper as a compatibility shim.
25-
26-
This public helper remains available for integrations importing
27-
``commitizen.bump.find_increment`` while delegating the real increment
28-
comparison and extraction logic to ``VersionIncrement``.
29-
"""
30-
increment = VersionIncrement.get_highest_by_messages(
31-
(commit.message for commit in commits),
32-
regex,
33-
increments_map,
34-
)
35-
if increment == VersionIncrement.NONE:
36-
return None
37-
return cast("Increment", str(increment))
16+
from commitizen.version_schemes import VersionProtocol
3817

3918

4019
def update_version_in_files(

‎commitizen/commands/bump.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,11 @@ def _find_increment(self, commits: list[git.GitCommit]) -> Increment | None:
160160
f"'{self.config.settings['name']}' rule does not support bump"
161161
)
162162

163+
commit_messages = (
164+
commit.message for commit in self.cz.filter_commits_before_bump(commits)
165+
)
163166
increment = VersionIncrement.get_highest_by_messages(
164-
(commit.message for commit in self.cz.filter_commits_before_bump(commits)),
167+
commit_messages,
165168
bump_pattern,
166169
bump_map,
167170
)
325 Bytes
Loading
2.24 KB
Loading
371 Bytes
Loading
242 Bytes
Loading
1.3 KB
Loading

0 commit comments

Comments
 (0)