Repository navigation
Commit 0f5fe53
fix(scm-provider): prefer full version over floating tags
Motivation: With tags v1.0.0, v1.0 and v1 on one commit, the scm version
provider returned "1.0". The three versions compare equal, and max()
kept the first one, which is the newest tag by date. The patch part was
dropped from the project version.
Approach: Break ties between equal versions by choosing the longest
spelling, so 1.0.0 wins over 1.0 and 1. Ordering of unequal versions is
unchanged.
Validation: `uv run pytest -n0` passed (1331 passed, 2 skipped,
2 xfailed). The new test fails without the change and passes with it.
`ruff check`, `ruff format --check` and `mypy commitizen/providers`
pass. `uv run poe all` was not run in full.
Impact: Only affects `version_provider = "scm"` when equal-valued tags
with different lengths exist. Only the version printed or used was
wrong; nothing else changed.
Report: #1863
Assisted By: AI
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Assisted-by: claude-sonnet-5-5 (via Claude Code)1 parent b78d581 commit 0f5fe53
2 files changed
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
0 commit comments