commitizen / commitizen/cz-cli

Comittizen runs twice when using the `prepare-commit-msg` hook

Open
#924 4 comments 9 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
17.5k
Forks
566
Avg merge
8h 16m
Merged PRs (30d)
1

Description

Steps to re-produce

1. Create a `prepare-commit-msg` hook:
``` #sh
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

exec < /dev/tty && node_modules/.bin/cz --hook || true

```
2. Run `git commit`
3. Follow the CLI
4. Everything works as expected.
5. Run `git cz`
6. Follow the CLI
7. Everything goes as expected except that, after we complete the wizard, Comittizen opens up again.

Is there any way to prevent `prepare-commit-msg` hook from running when executing `git cz`?

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.