-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
cz commit with prepare-commit-msg hook #249
Comments
I love this new feature! I never thought we could use git hook like this. One problem I can think of is the compatibility for windows users. We might make some more tests before we can accept it. @woile What do you think? |
Quite interesting indeed, please open a PR so we can discuss it there! |
Although we have a PR #250, I'm not able to reproduce the result. Might need some help from one with linux machine |
Hi @Lee-W, is there any update on this? Would love to automatically replace |
Hi @mrlubos , @saygox is working on that and is almost done. But we encounter this issue and might need some time to tackle it. Would love to hear your thought if you have an idea on how this could be solved |
Awesome @Lee-W! Admittedly, I am not very familiar with the Python ecosystem, but I wonder if you're able to solve this similarly to how npm packages handle it? https://github.com/commitizen/cz-cli |
@mrlubos Thanks for your sharing! In fact, part of the code I contribute is inspired by theirs. Wondering would it be possible for you to point out what might be the modules that I need to take a look at in that project? I must admit I'm not super familiar with JS. With your help, I believe we can solve this issue much faster. |
@Lee-W Let's try! It appears to me that we're not actually looking to replace The way it works in npm with husky (npm equivalent of pre-commit) is you need to create a #!/bin/sh
. "$(dirname "$0")/_/husky.sh"
if [ -n "$CI" ]; then
yarn git-cz --hook || true;
else
exec < /dev/tty && yarn git-cz --hook || true;
fi When I run Based on the commitizen CLI docs, As it turns out, the The important part of this hook can be found in the In summary, I understand that we want to add a Let me know if you want me to dig into anything else in that repository! |
@mrlubos Thanks for the summary! It's super helpful. I'll take a deeper look and see how I can fix it when I have time 💪 |
Any update on this feature or is there no longer interest? |
I've not yet had the time to get back to it. The last time I tested on my local machine. It failed. |
Close as #731 was merged |
Description
cz commit is very good tool.
If prepare-commit-msg hook calls cz commit, become easy to commit by many user.
Possible Solution
like cz check, writing pre-commit config
and user type git comit, then prepare-commit-msg hook works and invokes cz commit.
Is this feature accepted as this product policy?
Additional context
I did a basic research. And I found that there are two issues.
I made a test implementation to solve the problem by the following method
but this change has sideffect.
tty is manually opened as io.FileIO.
But prompt_toolkit (which used by questionary) assumes tty is opened as io.TextIOWrapper.
As a workaround I added wrap class
All patch code is here.
saygox@033159d
The text was updated successfully, but these errors were encountered: