commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

[Feature Request] Execute pre-commit hooks before prompting for the message

Open lyz-code opened this issue 5 years ago • 4 comments

Description

If any pre-commit hook fails, the commitizen message is lost and you need to run cz c --retry.

Possible Solution

If the hooks are run before prompting the user for input this would be avoided. Plus is the default git behavior.

lyz-code avatar Jul 14 '20 20:07 lyz-code

It's a great idea! I also suffer from this time to time.

Lee-W avatar Jul 15 '20 03:07 Lee-W

After a second through, I'm not sure it's a good idea. commitizen works more like git commit -m instead of git commit and then enter an editor. I don't think we should actively trigger pre-commit before commitizen. Currently, I can not think of other good solutions for it.

Lee-W avatar Jul 26 '20 08:07 Lee-W

@Lee-W we should at least make the --retry option more prominent in the README. This leads to a lot less headaches.

alecgerona avatar Sep 11 '20 03:09 alecgerona

@alecgerona I just add a new issue so that we won't forget it. https://github.com/commitizen-tools/commitizen/issues/268

Lee-W avatar Sep 16 '20 02:09 Lee-W