Skip to content

Commit 0999ef6

Browse files
committed
docs(bump): add description for bump "--allow-no-commit" argument
1 parent d9a3c30 commit 0999ef6

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

Diff for: docs/bump.md

+34-12
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ Some examples of pep440:
5454
$ cz bump --help
5555
usage: cz bump [-h] [--dry-run] [--files-only] [--local-version] [--changelog] [--no-verify] [--yes] [--tag-format TAG_FORMAT]
5656
[--bump-message BUMP_MESSAGE] [--prerelease {alpha,beta,rc}] [--devrelease DEVRELEASE] [--increment {MAJOR,MINOR,PATCH}]
57-
[--check-consistency] [--annotated-tag] [--gpg-sign] [--changelog-to-stdout] [--git-output-to-stderr] [--retry] [--major-version-zero]
58-
[--prerelease-offset PRERELEASE_OFFSET] [--version-scheme {pep440,semver,semver2}] [--version-type {pep440,semver,semver2}] [--build-metadata BUILD_METADATA]
57+
[--increment-mode {linear,exact}] [--check-consistency] [--annotated-tag] [--annotated-tag-message ANNOTATED_TAG_MESSAGE]
58+
[--gpg-sign] [--changelog-to-stdout] [--git-output-to-stderr] [--retry] [--major-version-zero] [--template TEMPLATE]
59+
[--extra EXTRA] [--file-name FILE_NAME] [--prerelease-offset PRERELEASE_OFFSET] [--version-scheme {pep440,semver2,semver}]
60+
[--version-type {pep440,semver2,semver}] [--build-metadata BUILD_METADATA] [--allow-no-commit]
5961
[MANUAL_VERSION]
6062

6163
positional arguments:
@@ -79,30 +81,38 @@ options:
7981
specify non-negative integer for dev. release
8082
--increment {MAJOR,MINOR,PATCH}
8183
manually specify the desired increment
82-
--increment-mode
83-
set the method by which the new version is chosen. 'linear' (default) guesses the next version based
84-
on typical linear version progression, such that bumping of a pre-release with lower precedence than
85-
the current pre-release phase maintains the current phase of higher precedence. 'exact' applies the
86-
changes that have been specified (or determined from the commit log) without interpretation, such that
87-
the increment and pre-release are always honored
84+
--increment-mode {linear,exact}
85+
set the method by which the new version is chosen. 'linear' (default) guesses the next version based on typical
86+
linear version progression, such that bumping of a pre-release with lower precedence than the current pre-release
87+
phase maintains the current phase of higher precedence. 'exact' applies the changes that have been specified (or
88+
determined from the commit log) without interpretation, such that the increment and pre-release are always honored
8889
--check-consistency, -cc
8990
check consistency among versions defined in commitizen configuration and version_files
9091
--annotated-tag, -at create annotated tag instead of lightweight one
92+
--annotated-tag-message ANNOTATED_TAG_MESSAGE, -atm ANNOTATED_TAG_MESSAGE
93+
create annotated tag message
9194
--gpg-sign, -s sign tag instead of lightweight one
9295
--changelog-to-stdout
9396
Output changelog to the stdout
9497
--git-output-to-stderr
9598
Redirect git output to stderr
9699
--retry retry commit if it fails the 1st time
97100
--major-version-zero keep major version at zero, even for breaking changes
101+
--template TEMPLATE, -t TEMPLATE
102+
changelog template file name (relative to the current working directory)
103+
--extra EXTRA, -e EXTRA
104+
a changelog extra variable (in the form 'key=value')
105+
--file-name FILE_NAME
106+
file name of changelog (default: 'CHANGELOG.md')
98107
--prerelease-offset PRERELEASE_OFFSET
99108
start pre-releases with this offset
100-
--version-scheme {pep440,semver,semver2}
109+
--version-scheme {pep440,semver2,semver}
101110
choose version scheme
102-
--version-type {pep440,semver,semver2}
111+
--version-type {pep440,semver2,semver}
103112
Deprecated, use --version-scheme
104-
--build-metadata {BUILD_METADATA}
105-
additional metadata in the version string
113+
--build-metadata BUILD_METADATA
114+
Add additional build-metadata to the version-number
115+
--allow-no-commit bump version without eligible commits
106116
```
107117
108118
### `--files-only`
@@ -337,6 +347,18 @@ You should normally not use this functionality, but if you decide to do, keep in
337347
* 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.
338348
* It might be problematic having the metadata in place when doing upgrades depending on what tool you use.
339349
350+
### `--allow-no-commit`
351+
352+
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]`
353+
354+
```sh
355+
# bump a minor version even when there's only bug fixes, documentation changes or even no commits
356+
cz bump --incremental MINOR --allow-no-commit
357+
358+
# bump version to 2.0.0 even when there's no breaking changes changes or even no commits
359+
cz bump --allow-no-commit 2.0.0
360+
```
361+
340362
## Avoid raising errors
341363
342364
Some situations from commitizen raise an exit code different than 0.

0 commit comments

Comments
 (0)