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
Commit e87930c
Browse filesBrowse the repository at this point in the historyBrowse files
Closes#1934.
Adds a `--merge-prerelease` CLI flag to `cz bump` that mirrors the
existing flag of `cz changelog`. When passed, it overrides the
`changelog_merge_prerelease` setting for a single bump invocation,
which is useful when you want to keep prerelease entries in the
changelog by default but collapse them on a release bump.
The implementation adds the flag to `commitizen/cli.py`, threads it
through the `BumpArgs` TypedDict, and forwards it to the embedded
`Changelog` invocation in `commands/bump.py`. The pre-existing
`Changelog` argument plumbing (`merge_prerelease` -> `tag_rules.
merge_prereleases`) is unchanged.
Also adds a parameterised test that proves the CLI flag enables
merging even when the config setting is left at its default
(`false`), reusing the existing fixture content.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/commands/bump.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,6 +226,16 @@ Useful when used with `--changelog-to-stdout` and piping the output to a file.
226
226
227
227
For example, `git commit` output may pollute `stdout`, so it is recommended to use this flag when piping the output to a file.
228
228
229
+
### `--merge-prerelease`
230
+
231
+
Collect all changes from prereleases into the next non-prerelease entry when generating the incremental changelog.
232
+
233
+
This mirrors the `--merge-prerelease` flag of `cz changelog` and overrides the [`changelog_merge_prerelease`](./changelog.md#--merge-prerelease) setting for a single bump invocation. It is useful when you want to keep prerelease entries in the changelog by default but collapse them on a release bump:
234
+
235
+
```bash
236
+
cz bump --changelog --merge-prerelease
237
+
```
238
+
229
239
### `--retry`
230
240
231
241
If you use tools like [pre-commit](https://pre-commit.com/), you can add this flag.
0 commit comments