Skip to content

Commit 38b42da

Browse files
committed
docs(bump): add notes on incomplete version handling and tag formatting
1 parent f5262a0 commit 38b42da

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/commands/bump.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ You can also set this in the configuration file with `version_scheme = "semver"`
6565
| Devrelease | `0.1.1.dev1` | `0.1.1-dev1` |
6666
| Dev and pre | `1.0.0a3.dev1` | `1.0.0-a3-dev1` |
6767

68+
69+
!!! note "Incomplete Version Handling"
70+
Commitizen treats a three-part version (major.minor.patch) as complete.
71+
If your configured version is incomplete (for example, `1` or `1.2`), Commitizen pads missing parts with zeros when it needs `major/minor/patch` for tag formatting.
72+
The tag output depends on your `tag_format`: formats using `${version}` keep `1`/`1.2`, while formats using `${major}.${minor}.${patch}` will render `1.0.0`/`1.2.0`.
73+
74+
When bumping from an incomplete version, Commitizen looks for the latest existing tag that matches the provided release prefix.
75+
For example, if the current version is `1.2` and the latest `1.2.x` tag is `1.2.3`, then a patch bump yields `1.2.4` and a minor bump yields `1.3.0`.
76+
77+
!!! tip
78+
To control the behaviour of bumping and version parsing, you may implement your own `version_scheme` by inheriting from `commitizen.version_schemes.BaseVersion` or use an existing plugin package.
79+
80+
6881
### PEP440 Version Examples
6982

7083
Commitizen supports the [PEP 440][pep440] version format, which includes several version types. Here are examples of each:

0 commit comments

Comments
 (0)