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
2nd git.commit error: "On branch main nothing to commit, working tree clean" #1530
Triage from #1964: Confirmed still valid on master (4.15.1). commitizen/commands/bump.py (lines 385-394) calls git commit -a and treats a non-zero return code as fatal. With version_provider = "scm" and no version_files / changelog updates, there's nothing for the bump commit to include, so git exits with "nothing to commit". Fix should detect this case (e.g., check is_staging_clean() before commit, or treat the "nothing to commit" return code gracefully) and skip the bump commit, just creating the tag on HEAD.
Config: version_provider = "scm" only, no version_files, no changelog updates.
After staging cz.toml and committing feat: initial, running cz bump --yes exits 6 with:
bump: version 0.0.0 → 0.1.0
tag to create: 0.1.0
increment detected: MINOR
2nd git.commit error: "On branch main
nothing to commit, working tree clean
"
No tag is created. Even the first bump fails because there are no files to update.
Verdict: STILL VALID — and slightly worse than the original report, which had the first bump succeed (probably because of cz.toml modifications by older commitizen versions).
Suggested fix in commitizen/commands/bump.py:
Before calling git.commit(...), check whether anything is staged (git.is_staging_clean()).
If clean, skip the commit and just create the tag on HEAD.
This naturally handles the version_provider = "scm" no-op-bump case without requiring users to set update_changelog_on_bump.
Activity
Lee-W commentedon Jun 10, 2025
With
update_changelog_on_bump = true, it works fine, but this is a valid bug. Thanks for reporting!loelkes commentedon Jun 10, 2025
This came to light while building a workaround for #883
Since I can't use the changelog due to this bug I run
cz bumpwithout--changelog/update_changelog_on_bump = truewoile commentedon Jun 10, 2025
There's a PR open supposed to fix this
#996
Lee-W commentedon Jun 11, 2025
oh.... I'll see whether I can make it merged in the next release
bearomorphism commentedon May 9, 2026
Triage from #1964: Confirmed still valid on master (4.15.1).
commitizen/commands/bump.py(lines 385-394) callsgit commit -aand treats a non-zero return code as fatal. Withversion_provider = "scm"and noversion_files/ changelog updates, there's nothing for the bump commit to include, so git exits with "nothing to commit". Fix should detect this case (e.g., checkis_staging_clean()before commit, or treat the "nothing to commit" return code gracefully) and skip the bump commit, just creating the tag onHEAD.bearomorphism commentedon May 9, 2026
Verification update (re #1964)
Reproduced against current master (4.15.1):
Config:
version_provider = "scm"only, no version_files, no changelog updates.After staging
cz.tomland committingfeat: initial, runningcz bump --yesexits 6 with:No tag is created. Even the first bump fails because there are no files to update.
Verdict: STILL VALID — and slightly worse than the original report, which had the first bump succeed (probably because of
cz.tomlmodifications by older commitizen versions).Suggested fix in
commitizen/commands/bump.py:git.commit(...), check whether anything is staged (git.is_staging_clean()).HEAD.version_provider = "scm"no-op-bump case without requiring users to setupdate_changelog_on_bump.The git tag is the version, and `release patch` is the whole release …