-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Gitmoji -c with husky pre-commit #700
Comments
Hey @codingedgar this is a great question 😊 I totally understand your concern, sometimes I also experience this issue too 😂, we built two things into the cli to make this process of "retrying a commit" faster with two options:
Option 1, allows you to pre-fill some values that will be applied to the commit, so in case something fails, you can use the arrow up key and have all the inputs filled. Option 2, prints the git command to the error log, in case you want to copy it and execute again the same commit. Probably there's a better way to do this, I'm open to suggestions for improving this Thanks! |
Thank you for the quick and comprehensive reply 💛 I'll try the 1st approach, which probably is what I'm looking for, I use the 2nd which is not convenient with multi-line (a I have some ideas:
I think all of them have their pros and cons |
Oh, I just noticed the message at the end with the whole command inline and is copied and pasted nicely, no new lines added, I was copying from the log at the beginning which does add a new line. Also, I think |
Not sure If I follow, what do you mean by retry? If a pre-commit hook fails for some reason, the user will need to perform an action to fix it and then retry the commit again. We can't implement an automatic retry with |
Sorry for not specifying, 1 and 2 mean retry manually. In 1, the terminal waits for user confirmation to retry (by a keystroke And in 2, the terminal finishes with an error, saves the title/message in a file, and when the user types something like |
Hello again!
This option is a great idea 😊 We should save the last full command into a temporary file and then re-execute it with the --retry flag. Not sure if there's another potential approach but maybe we can use conf for that? |
that sounds very nice, seems like a perfect candidate. So the mechanism is saving the current full command with If so, i could try to make a PR with the change if that's ok? |
after a debate with "maybe using I think the Maybe explaining the benefits of |
I see! I think both options are useful but depending your use-case the hook approach might be a better choice. I will try to update and reflect this on the docs 😊 |
Hello @carloscuesta!
Hi, first of all, amazing lib 💛
Issue:
When I commit and husky pre-commit hook fails it's easy to fix the issue and press arrow up and my single line commit message is there, but with
gitmoji -c
i have to do it all over again.I know this is not a bug, but is there a harmonic way to integrate husky with
gitmoji -c
? (I haven't tried the gitmoji hook, because I have not officially introduced gitmoji to my project, I'm just testing waters with the team)OS: macOS Big Sur
gitmoji -v: 4.7.0
Node version: 14.17.0
The text was updated successfully, but these errors were encountered: