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
Empty commit messages indicate to Git that the commit should be aborted.
Displaying an error message when the commit is already being aborted
typically only creates confusion. Add an --allow-abort argument to the
check command and allow_abort config variable, both defaulting to false
for backwards compatibility. When the commit message is empty, determine
the outcome based on the allow_abort setting alone, ignoring the
pattern.
Copy file name to clipboardExpand all lines: docs/check.md
+14-1
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,11 @@ If you want to setup an automatic check before every git commit, please refer to
7
7
[Automatically check message before commit](auto_check.md).
8
8
9
9
## Usage
10
-
There are three arguments that you can use one of them to check commit message.
10
+
There are three mutually exclusive ways to use `cz check`:
11
+
12
+
- with `--rev-range` to check a range of pre-existing commits
13
+
- with `--message` or by piping the message to it to check a given string
14
+
- or with `--commit-msg-file` to read the commit message from a file
11
15
12
16
### Git Rev Range
13
17
If you'd like to check a commit's message after it has already been created, then you can specify the range of commits to check with `--rev-range REV_RANGE`.
In this option, COMMIT_MSG_FILE is the path of the temporal file that contains the commit message.
48
52
This argument can be useful when cooperating with git hook, please check [Automatically check message before commit](auto_check.md) for more information about how to use this argument with git hook.
53
+
54
+
### Allow Abort
55
+
56
+
```bash
57
+
cz check --message MESSAGE --allow-abort
58
+
```
59
+
60
+
Empty commit messages typically instruct Git to abort a commit, so you can pass `--allow-abort` to
61
+
permit them. Since `git commit` accepts an `--allow-empty-message` flag (primarily for wrapper scripts), you may wish to disallow such commits in CI. `--allow-abort` may be used in conjunction with any of the other options.
| `changelog_incremental` | `bool` | `false` | Update changelog with the missing versions. This is good if you don't want to replace previous versions in the file. Note: when doing `cz bump --changelog` this is automatically set to `true` |
136
137
| `changelog_start_rev` | `str` | `None` | Start from a given git rev to generate the changelog |
0 commit comments