Program hangs if repo uses prepare-commit-hook that requires user input
- Vorherrschende Sprache
- Rust
- Sterne
- 22.5k
- Forks
- 773
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
**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](https://github.com/commitizen/cz-cli#traditional-git-hooks)
**To Reproduce**
minimal example here: https://github.com/jaredmcateer/cz-gitui
Steps to reproduce the behavior:
1. Open repo with prepare-commit-msg that requires user input
2. Add/Modify a file
3. Stage file
4. Go to 'staged change' in gitui
5. Press 'c'
7. Observe gitui is unresponsive
**Screenshots**
In your processes you will see something like this:

**Context (please complete the following information):**
- OS/Distro + Version: tested on Mac OS Sonoma 14.7.1 & Pop_OS! 22.0.4 LTS
- GitUI Version: gitui nightly 2025-03-04 ()
- Rust version: rustc 1.82.0 (f6e511eec 2024-10-15)
**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.
Beitragsleitfaden
Rechercherichtung
Beginne damit, den Hänger mit dem verlinkten minimalen cz-gitui-Repository und einem prepare-commit-msg-Hook zu reproduzieren, der Eingaben anfordert, und verfolge anschließend die durch commit, rebase, merge und cherry-pick ausgelösten Pfade in gitui. Vergleiche, wie diese Operationen die Eingabe und Ausgabe des Hooks behandeln. Als erledigt gilt die Aufgabe, wenn interaktive Hooks Eingaben empfangen können, ohne dass gitui nicht mehr reagiert, während andere Hooks weiterhin ausgeführt werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- git, rust
- Bereich
- cli, devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100