Skip to content

Commit

Permalink
docs(bump): add description for bump "--allow-no-commit" argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Apr 21, 2024
1 parent d9a3c30 commit 0999ef6
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions docs/bump.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ Some examples of pep440:
$ cz bump --help
usage: cz bump [-h] [--dry-run] [--files-only] [--local-version] [--changelog] [--no-verify] [--yes] [--tag-format TAG_FORMAT]
[--bump-message BUMP_MESSAGE] [--prerelease {alpha,beta,rc}] [--devrelease DEVRELEASE] [--increment {MAJOR,MINOR,PATCH}]
[--check-consistency] [--annotated-tag] [--gpg-sign] [--changelog-to-stdout] [--git-output-to-stderr] [--retry] [--major-version-zero]
[--prerelease-offset PRERELEASE_OFFSET] [--version-scheme {pep440,semver,semver2}] [--version-type {pep440,semver,semver2}] [--build-metadata BUILD_METADATA]
[--increment-mode {linear,exact}] [--check-consistency] [--annotated-tag] [--annotated-tag-message ANNOTATED_TAG_MESSAGE]
[--gpg-sign] [--changelog-to-stdout] [--git-output-to-stderr] [--retry] [--major-version-zero] [--template TEMPLATE]
[--extra EXTRA] [--file-name FILE_NAME] [--prerelease-offset PRERELEASE_OFFSET] [--version-scheme {pep440,semver2,semver}]
[--version-type {pep440,semver2,semver}] [--build-metadata BUILD_METADATA] [--allow-no-commit]
[MANUAL_VERSION]

positional arguments:
Expand All @@ -79,30 +81,38 @@ options:
specify non-negative integer for dev. release
--increment {MAJOR,MINOR,PATCH}
manually specify the desired increment
--increment-mode
set the method by which the new version is chosen. 'linear' (default) guesses the next version based
on typical linear version progression, such that bumping of a pre-release with lower precedence than
the current pre-release phase maintains the current phase of higher precedence. 'exact' applies the
changes that have been specified (or determined from the commit log) without interpretation, such that
the increment and pre-release are always honored
--increment-mode {linear,exact}
set the method by which the new version is chosen. 'linear' (default) guesses the next version based on typical
linear version progression, such that bumping of a pre-release with lower precedence than the current pre-release
phase maintains the current phase of higher precedence. 'exact' applies the changes that have been specified (or
determined from the commit log) without interpretation, such that the increment and pre-release are always honored
--check-consistency, -cc
check consistency among versions defined in commitizen configuration and version_files
--annotated-tag, -at create annotated tag instead of lightweight one
--annotated-tag-message ANNOTATED_TAG_MESSAGE, -atm ANNOTATED_TAG_MESSAGE
create annotated tag message
--gpg-sign, -s sign tag instead of lightweight one
--changelog-to-stdout
Output changelog to the stdout
--git-output-to-stderr
Redirect git output to stderr
--retry retry commit if it fails the 1st time
--major-version-zero keep major version at zero, even for breaking changes
--template TEMPLATE, -t TEMPLATE
changelog template file name (relative to the current working directory)
--extra EXTRA, -e EXTRA
a changelog extra variable (in the form 'key=value')
--file-name FILE_NAME
file name of changelog (default: 'CHANGELOG.md')
--prerelease-offset PRERELEASE_OFFSET
start pre-releases with this offset
--version-scheme {pep440,semver,semver2}
--version-scheme {pep440,semver2,semver}
choose version scheme
--version-type {pep440,semver,semver2}
--version-type {pep440,semver2,semver}
Deprecated, use --version-scheme
--build-metadata {BUILD_METADATA}
additional metadata in the version string
--build-metadata BUILD_METADATA
Add additional build-metadata to the version-number
--allow-no-commit bump version without eligible commits
```
### `--files-only`
Expand Down Expand Up @@ -337,6 +347,18 @@ You should normally not use this functionality, but if you decide to do, keep in
* 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.
* It might be problematic having the metadata in place when doing upgrades depending on what tool you use.
### `--allow-no-commit`
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]`
```sh
# bump a minor version even when there's only bug fixes, documentation changes or even no commits
cz bump --incremental MINOR --allow-no-commit
# bump version to 2.0.0 even when there's no breaking changes changes or even no commits
cz bump --allow-no-commit 2.0.0
```
## Avoid raising errors
Some situations from commitizen raise an exit code different than 0.
Expand Down

0 comments on commit 0999ef6

Please sign in to comment.