The config "changelog_merge_prerelease" is ignored when the changelog is modified through cz bump (--changelog)
Description
The config "changelog_merge_prerelease" is ignored when the changelog is modified through cz bump (--changelog).
I think I located the issue at https://github.com/commitizen-tools/commitizen/blob/9f3ec868c0429155a46b4819b625d47a8522a3d5/commitizen/commands/bump.py#L308-L314, where the args do not contain changelog command specific arguments. I can provide a PR over the weekend.
Steps to reproduce
- Create a test git repo
git init - Create a .cz.toml config with the following content:
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "semver2"
version = "0.1.0"
update_changelog_on_bump = true
changelog_merge_prerelease = true
- git add . && cz commit
- Create a prerelease with
cz bump --prerelease rc - Create the final release with
cz bumporcz bump --changelog
Current behavior
In step 4. the prerelease entry is created as expected, but it is not merged in step 5: Resulting changelog:
## 0.1.1 (2025-12-05)
## 0.1.1-rc.0 (2025-12-05)
Desired behavior
The release candidate is merged with the actual release:
## 0.1.1 (2025-12-05)
### Fix
...
The desired behavior may be observed by performing cz changelog.
Screenshots
No response
Environment
Commitizen Version: 4.10.0 Python Version: 3.14.1 (main, Dec 2 2025, 12:51:37) [Clang 17.0.0 (clang-1700.4.4.1)] Operating System: Darwin
I can provide a PR over the weekend.
Sounds good! Thanks for locating the issue!
We are also planning to redesign how commitizen pass options iirc
The code you located is really error prone when we are adding new options
We are also planning to redesign how commitizen pass options iirc
Sounds good! Unfortunately, my initial diagnosis was incorrect, as the argument is correctly passed. I opened a Draft PR, where the issue is fixed to the best of my ability.
Before manual testing and polishing the PR, I ask that someone with a deeper understanding of the codebase takes a look and provides feedback. I will be happy to incorporate it.
Haven't looked into the issue. I would suggest you to run a debugger if you're not sure what goes wrong