Skip to content

git commit -m to pre-fill commit title #847

Open
@glensc

Description

@glensc

With husky 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:

--- 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"
     }
   },

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions