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
Direct bump with changelog creation not possible using semver2, custom tag_format and prerelease option #1614
When using a custom tag_format like ${major}.${minor}-${patch}${prerelease} with semver2 the changelog cannot be create directly using cz bump --prerelase rc with update_changelog_on_bump = true. Only generating the changelog manually using cz ch lets the bump succeed.
The error occurse in a bump chain 0.0.1 → 0.0.2 → 0.0.3-rc.0 → 0.0.3-rc.1
Furthermore, using prereleases, cz changelog always throw warnings like:
Invalid version tag: '0.0-2rc.0' does not match any configured tag format
It seems that the git tag is not parsed correctly when using custom tag_format and semver2.
See a szenario in steps to reproduce.
Steps to reproduce
Initialize git project and place cz configuration:
git init .
cat << EOF | tee cz.toml
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "\${major}.\${minor}-\${patch}\${prerelease}"
version_scheme = "semver2"
version = "0.0.1"
update_changelog_on_bump = true
EOF
Triage from #1964: Still valid. The interaction between custom tag_format containing ${prerelease}, version_scheme = "semver2", and cz bump --prerelease produces 0.0-2rc.0 instead of the expected tag, and the changelog parser then can't recognise it. Likely shares a root cause with #1615 — needs investigation in commitizen/tags.py::normalize_tag.
Config: tag_format = "${major}.${minor}-${patch}${prerelease}", version_scheme = "semver2", version = "0.0.1".
After first cz bump --prerelease rc --yes:
git tag --list
0.0-2rc.0
The tag is malformed (note 0.0-2 instead of 0.0.2). Second cz bump --prerelease rc --yes fails:
Invalid version tag: '0.0-2rc.0' does not match any configured tag format
No tag found to do an incremental changelog
(exit 16)
cz changelog --dry-run also warns about the same invalid tag.
Verdict: STILL VALID. Two related root causes:
commitizen/tags.py::normalize_tag produces tags that can't be re-parsed by the same tag_format regex when the format mixes literal - with ${prerelease} and semver2 prerelease syntax.
The first bump's tag rendering is itself malformed (0.0-2rc.0 looks like the substitution interpreted ${patch} as ${minor}-${patch} boundaries unexpectedly).
Likely closely related to #1615 (devrelease substitution issue).
Activity
bearomorphism commentedon May 9, 2026
Triage from #1964: Still valid. The interaction between custom
tag_formatcontaining${prerelease},version_scheme = "semver2", andcz bump --prereleaseproduces0.0-2rc.0instead of the expected tag, and the changelog parser then can't recognise it. Likely shares a root cause with #1615 — needs investigation incommitizen/tags.py::normalize_tag.bearomorphism commentedon May 9, 2026
Verification update (re #1964)
Reproduced against current master (4.15.1):
Config:
tag_format = "${major}.${minor}-${patch}${prerelease}",version_scheme = "semver2",version = "0.0.1".After first
cz bump --prerelease rc --yes:The tag is malformed (note
0.0-2instead of0.0.2). Secondcz bump --prerelease rc --yesfails:cz changelog --dry-runalso warns about the same invalid tag.Verdict: STILL VALID. Two related root causes:
commitizen/tags.py::normalize_tagproduces tags that can't be re-parsed by the same tag_format regex when the format mixes literal-with${prerelease}and semver2 prerelease syntax.0.0-2rc.0looks like the substitution interpreted${patch}as${minor}-${patch}boundaries unexpectedly).Likely closely related to #1615 (devrelease substitution issue).
test(tags): add devrelease round-trip regression for commitizen-tools…
fix(tags): widen prerelease and devrelease tag regexes for SemVer2 (#…