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
feat: add changelog_skip_prereleases setting to omit prerelease entries
When changelog_skip_prereleases = true is set, prerelease tags (rc,
alpha, beta, dev) are omitted entirely from the generated changelog.
Both cz changelog and cz bump --changelog honour the setting.
When both changelog_skip_prereleases and changelog_merge_prerelease
are set, skip takes precedence and prerelease entries are dropped.
Closes#1218
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/commands/changelog.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,8 @@ Specify the name of the output file. Note that changelog generation only works w
85
85
cz changelog --file-name="CHANGES.md"
86
86
```
87
87
88
+
When provided on the command line, the path is interpreted **relative to the current working directory** (standard CLI convention).
89
+
88
90
This value can be updated in the configuration file with the key `changelog_file` under `tool.commitizen`.
89
91
90
92
```toml
@@ -93,6 +95,8 @@ This value can be updated in the configuration file with the key `changelog_file
93
95
changelog_file = "CHANGES.md"
94
96
```
95
97
98
+
When set in the configuration file, the path is resolved **relative to the configuration file's directory** (usually the project root). This means the location of the changelog is stable regardless of which directory you run `cz` from.
99
+
96
100
### `--incremental`
97
101
98
102
Build from the latest version found in changelog.
@@ -147,6 +151,30 @@ This flag can be set in the configuration file with the key `changelog_merge_pre
147
151
changelog_merge_prerelease = true
148
152
```
149
153
154
+
### `changelog_skip_prereleases`
155
+
156
+
Omits all prerelease versions (e.g. `rc`, `alpha`, `beta`, `dev`) from the changelog entirely. Stable-release entries are kept, but their commits are attributed only to the stable release — prerelease headers never appear.
157
+
158
+
This is a configuration-only option (no CLI flag); enable it in your `pyproject.toml`:
159
+
160
+
```toml
161
+
[tool.commitizen]
162
+
changelog_skip_prereleases = true
163
+
```
164
+
165
+
With this setting, a history such as:
166
+
167
+
```
168
+
0.1.0-a0 → 0.1.0-b0 → 0.1.0
169
+
```
170
+
171
+
will produce a changelog that shows only `0.1.0`, without `0.1.0-a0` or `0.1.0-b0` entries.
172
+
173
+
!!! note
174
+
When both `changelog_skip_prereleases = true` and `changelog_merge_prerelease = true` are set,
175
+
`changelog_skip_prereleases` takes precedence and prerelease entries are dropped rather than
176
+
merged.
177
+
150
178
### `--template`
151
179
152
180
Provide your own changelog Jinja template by using the `template` settings or the `--template` parameter.
0 commit comments