feat(git-commit): support optional commit body (#14169)

This commit is contained in:
Federico Tensi authored and GitHub committed 2026-11-26 07:28:56 -08:00
1 parent b1d468701a
commit e333686c2a
2 files changed
+17 -5

No files matched your search

+6 -2
View File
@@ -12,7 +12,7 @@ plugins=(... git-commit)
## Syntax
```zsh
git <type> [(-s, --scope) "<scope>"] [(-a, --attention)] "<message>"
git <type> [(-s, --scope) "<scope>"] [(-a, --attention)] [(-b, --body) "<body>"] "<message>"
```
Where `type` is one of the following:
@@ -30,6 +30,9 @@ Where `type` is one of the following:
- `test`
- `wip`
The optional `-b` / `--body` becomes the commit body (a blank line after the subject), as defined by
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary).
> NOTE: the subcommand for `revert` type is `rev`, as otherwise it conflicts with the
> git command of the same name. It will still generate a commit message in the format
> `revert: <message>`
@@ -39,6 +42,7 @@ Where `type` is one of the following:
| Git subcommand | Command |
| --------------------------------------------- | ---------------------------------------------------- |
| `git style "remove trailing whitespace"` | `git commit -m "style: remove trailing whitespace"` |
| `git wip "work in progress"` | `git commit -m "work in progress"` |
| `git wip "work in progress"` | `git commit -m "wip: work in progress"` |
| `git fix -s "router" "correct redirect link"` | `git commit -m "fix(router): correct redirect link"` |
| `git rev -s "api" "rollback v2"` | `git commit -m "revert(api): rollback v2"` |
| `git feat -s "auth" -b "Keep session across redirects." "add login redirect"` | `git commit -m "feat(auth): add login redirect" -m "Keep session across redirects."` |