Skip to content

Commit 10740c9

Browse files
committed
docs(bump): add description for bump "--allow-no-commit" argument
1 parent ba5a71a commit 10740c9

File tree

6 files changed

+511
-479
lines changed

6 files changed

+511
-479
lines changed

docs/commands/bump.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ Some examples of pep440:
5252

5353
![cz bump --help](../images/cli_help/cz_bump___help.svg)
5454

55-
5655
### `--files-only`
5756

5857
Bumps the version in the files defined in `version_files` without creating a commit and tag on the git repository,
@@ -178,6 +177,7 @@ If `--local-version` is used, it will bump only the local version `0.1.0` and ke
178177
If `--annotated-tag` is used, commitizen will create annotated tags. Also available via configuration, in `pyproject.toml` or `.cz.toml`.
179178

180179
### `--annotated-tag-message`
180+
181181
If `--annotated-tag-message` is used, commitizen will create annotated tags with the given message.
182182

183183
### `--changelog-to-stdout`
@@ -276,14 +276,14 @@ cz bump --build-metadata yourmetadata
276276

277277
Will create a version like `1.1.2+yourmetadata`.
278278
This can be useful for multiple things
279-
* Git hash in version
280-
* Labeling the version with additional metadata.
279+
- Git hash in version
280+
- Labeling the version with additional metadata.
281281

282282
Note that Commitizen ignores everything after `+` when it bumps the version. It is therefore safe to write different build-metadata between versions.
283283

284284
You should normally not use this functionality, but if you decide to do, keep in mind that
285-
* Version `1.2.3+a`, and `1.2.3+b` are the same version! Tools should not use the string after `+` for version calculation. This is probably not a guarantee (example in helm) even tho it is in the spec.
286-
* It might be problematic having the metadata in place when doing upgrades depending on what tool you use.
285+
- Version `1.2.3+a`, and `1.2.3+b` are the same version! Tools should not use the string after `+` for version calculation. This is probably not a guarantee (example in helm) even tho it is in the spec.
286+
- It might be problematic having the metadata in place when doing upgrades depending on what tool you use.
287287

288288
### `--get-next`
289289

@@ -318,6 +318,18 @@ The `--get-next` flag will raise a `NoneIncrementExit` if the found commits are
318318

319319
For information on how to suppress this exit, see [avoid raising errors](#avoid-raising-errors).
320320

321+
### `--allow-no-commit`
322+
323+
Allow the project version to be bumped even when there's no eligible version. This is most useful when used with `--increment {MAJOR,MINOR,PATCH}` or `[MANUL_VERSION]`
324+
325+
```sh
326+
# bump a minor version even when there's only bug fixes, documentation changes or even no commits
327+
cz bump --incremental MINOR --allow-no-commit
328+
329+
# bump version to 2.0.0 even when there's no breaking changes changes or even no commits
330+
cz bump --allow-no-commit 2.0.0
331+
```
332+
321333
## Avoid raising errors
322334

323335
Some situations from commitizen raise an exit code different than 0.
@@ -389,13 +401,13 @@ cz -nr 21 bump
389401

390402
These are used in:
391403

392-
* `cz bump`: Find previous release tag (exact match) and generate new tag.
393-
* Find previous release tags in `cz changelog`.
394-
* If `--incremental`: Using latest version found in the changelog, scan existing Git tags with 89\% similarity match.
395-
* `--rev-range` is converted to Git tag names with `tag_format` before searching Git history.
396-
* If the `scm` `version_provider` is used, it uses different regexes to find the previous version tags:
397-
* If `tag_format` is set to `$version` (default): `VersionProtocol.parser` (allows `v` prefix)
398-
* If `tag_format` is set: Custom regex similar to SemVer (not as lenient as PEP440 e.g. on dev-releases)
404+
- `cz bump`: Find previous release tag (exact match) and generate new tag.
405+
- Find previous release tags in `cz changelog`.
406+
- If `--incremental`: Using latest version found in the changelog, scan existing Git tags with 89\% similarity match.
407+
- `--rev-range` is converted to Git tag names with `tag_format` before searching Git history.
408+
- If the `scm` `version_provider` is used, it uses different regexes to find the previous version tags:
409+
- If `tag_format` is set to `$version` (default): `VersionProtocol.parser` (allows `v` prefix)
410+
- If `tag_format` is set: Custom regex similar to SemVer (not as lenient as PEP440 e.g. on dev-releases)
399411

400412
Commitizen supports 2 types of formats, a simple and a more complex.
401413

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy