-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): Implement --hook option for git hooks integration #615
Conversation
First of all I'd like to say thanks to all the contributors and maintainers for making such a useful tool. A little backstory on this pull request - as a developer on the open-source BIDS-Validator project, I wished to use |
Snippet from the README for use-cases Optional: Running Commitizen on
|
4917d18
to
0630aef
Compare
88d32b1
to
db15306
Compare
using git cz --hook in a git hook will allow 'git commit' to trigger commitizen fix commitizen#448, re commitizen#462
examples of how to incorporate commitizen into traditional git hooks + husky hooks
hi,I use this option,but it still have a problem like this when I run [git commit]: git exited with error code 129 |
@wilddancers thanks for finding a bug! i'd like to figure out if this is an error with the code itself or the documentation.What happens if you try the following hook?
Also what OS are you using? |
@olgn thanks for replaying me,my env is: |
@wilddancers I have been able to reproduce this locally due to a failure linking this pr branch to the package manager registry - please try the following steps to get this to work. First of all, this is a new feature, so you should make sure that the your project's commitzen cli is pointing at the correct branch (via
If all that works out and you still get error code 129, let me know. |
if you want to use this feature in production, I suggest you wait until this pr is merged... but all review is welcome! |
@olgn I too encountered that error, but the cause was streamich/git-cz adapter. I have a feeling the '--hook' flag is not being removed from the args and is propagating to the git commit command. |
fixes #448
re #462
This pr allows project maintainers to enforce Commitizen generated commit messages as part of the workflow triggered by the
git commit
command.--hook
flag, which directs Commitizen to edit the.git/COMMIT_EDITMSG
file directly.--hook
flag in theREADME
, both through traditionalgit hooks
andhusky
.