cz-cli
cz-cli copied to clipboard
git commit not returning to prompt
After running git commit
and going through the interactive prompts, commitizen doesn't return to prompt. Instead it puts me into vim and am forced to exist with :qa
.
I'm using the husky method:
"husky": {
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
}
}
My environment: OSX: 10.15.7 Yarn 1.22.10 Node 12.20.1 NPM 6.14.10 commitizen: 4.2.3 cz-conventional-changelog: 3.3.0
Same here. Until today, commitizen
was working well.
OSX: 11.2 Node: 15.8.0 NPM: 7.5.2 commitizen: 4.2.3 husky: 5.0.8
prepare-commit-msg
#!/bin/sh
. "$(dirname $0)/_/husky.sh"
exec < /dev/tty && npx --no-install git cz --hook || true
I also got this error message: "could not determine executable to run".
I got the same message when I manually execute npx --no-install git cz --hook
.
Are there any steps to collect further info for diagnosis?
EDIT:
git-cz
is locally installed and npx git-cz
works.
Can I use exec < /dev/tty && npx --no-install git-cz --hook || true
until a solution found?
I think changing the prepare-commit-msg to below works
#!/bin/sh
. "$(dirname $0)/_/husky.sh"
exec < /dev/tty && npx git-cz --hook || true
👆
I think changing the prepare-commit-msg to below works
#!/bin/sh . "$(dirname $0)/_/husky.sh" exec < /dev/tty && npx git-cz --hook || true
This doesn't solve the issue. Maybe it has something to do with yarn?
I think changing the prepare-commit-msg to below works
#!/bin/sh . "$(dirname $0)/_/husky.sh" exec < /dev/tty && npx git-cz --hook || true
This doesn't work! and vim open again.
Same issue here
Same problem. Cant find solution
had the same problem on
ubuntu 22.04
node v16.18.1
but after trying with git-cz
error changed to:
npx --no-install git-cz
npm ERR! canceled
:shrug:
I solved it by adding commitizen as a devDependency to the project. The husky hook requires commitizen to be installed locally as mentioned in notes.