-
-
Notifications
You must be signed in to change notification settings - Fork 301
Open
Labels
Description
Description
When using a custom tag format like ${major}.${minor}-${patch}${devrelease}
with semver2
the created tags miss the devrelease
part. Further devreleases fail due to duplicate tags.
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}\${devrelease}"
version_scheme = "semver2"
version = "0.0.1"
update_changelog_on_bump = true
EOF
- Create a first commit
echo "# test" | tee README.md
git add README.md cz.toml
git commit -m "fix: Add readme file"
- Bump a devrelease
cz bump --devrelease 1 --yes
- Observe incorrect "tag to create" in output tag (note ${devrelease})
bump: version 0.0.1 → 0.0.2-dev.1
tag to create: 0.0-2${devrelease}
increment detected: PATCH
- Observe inccorect git tag
git tag -l
- Trying to add more changes and bump the next devrelease will fail
Current behavior
No devrelease
part is added according to the configuration. The tag equals ${major}.${minor}-${patch}
which produces further errors using a next devrelease.
Desired behavior
The tag shall be set correctly according to custom tag_format and semver2 convention like 0.0-2dev1
Screenshots
n/a
Environment
Commitizen Version: 4.9.1
Python Version: 3.9.21 (main, Aug 19 2025, 00:00:00)
[GCC 11.5.0 20240719 (Red Hat 11.5.0-5)]
Operating System: Linux