commitizen / commitizen/cz-cli

git commit -m to pre-fill commit title

Open
#847 9 comments 9 reactions 1 assignee Claimed by @dmwelch View on GitHub
Dominant language
JavaScript
Stars
17.5k
Forks
566
Avg merge
8h 16m
Merged PRs (30d)
1

Description

With [husky][1] setup, the `-m` is lost.

I'm a CLI guru, so if I typed `-m` already, it should be used as a base, for example, add the category to it unless missing.

```
$ git commit -m 'Add prepare commit msg hook'
$ git commit -m 'feat: Add prepare commit msg hook'
```

currently have to re-type everything with several prompts. kind of slows down the commit process, driving away from the git hook setup.

Husky part:
```diff
--- a/package.json
+++ b/package.json
@@ -105,6 +105,7 @@
},
"husky": {
"hooks": {
+ "prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
"pre-commit": "lint-staged"
}
},
```

[1]: https://github.com/commitizen/cz-cli#husky

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.