-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
Program hangs if repo uses prepare-commit-hook that requires user input #2546
Comments
this sounds like a near impossible issue to fix, the easy solution might be adding a timeout to the command invocation. |
@DaRacci i agree that is what we should do here. interested in giving this a go? |
FWIW I found lazygit allows committing via the system editor with shift+c which does allow gracefully handling the hook, but they have no functionality for the other commands that trigger the I understand if this is too much work. I tend to agree with the sentiment that what commitizen is doing is going against the spirit of git hooks. I just happen to work on a lot of repos that aren't mine with it and having my TUI frozen trying to do something like a rebase drives me a bit batty, so at least having a timeout is better than having to kill the process and reset my terminal. |
how does using the system editor allow these hooks to work, i may not quite be following could you record a clip of how this functions? |
Yea sure. Sorry I'm on wayland and I haven't quite figured out how to get something going that shows my key presses in screencasts but basically I stage the file, press shift+c it switches the the terminal where I can follow commitizens prompts, it then drops me into my lazygit.webm |
Thanks for the demo, I was hoping this would give a lead but it seems like its just dropping you into a shell where git commit has been ran. |
Describe the bug
If a repo implements a prepare-commit-msg which requires user input gitui will hang on various operations that trigger the hook (commit, rebase, merge, cherry pick).
This is a pretty common pattern in repos using commitizen as one of the options that the project recommends is using prepare-commit-msg
To Reproduce
minimal example here: https://github.com/jaredmcateer/cz-gitui
Steps to reproduce the behavior:
Screenshots
In your processes you will see something like this:

Context (please complete the following information):
Additional context
Lazygit also suffers from this, and the current workaround is to override all the commit-like commands with custom keybindings to disable Husky, but that will also kill other useful things like pre-commit hooks that run tests/linters.
The text was updated successfully, but these errors were encountered: