-
-
Notifications
You must be signed in to change notification settings - Fork 609
pre-commit hook is run at the wrong time #1711
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
Comments
Can you make the case by adding links to where these orders are defined? |
https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks "The pre-commit hook is run first, before you even type in a commit message." |
since this is low-prio to me right now |
I am happy to leave it as is and run
exact parity is obviously not possible because UX of a cli and a GUI is just different. I am fine to be consistent with other tools (see above). last but not least remember you compare apples and oranges: running |
Working on prepare-commit-msg hook (still).
prepare-commit-msg needs to run before commit message dialog is shown, this is doable . But in working on where to place that hook I find that the pre-commit hook is run at the wrong time. It should be run before the user gets to type in the commit message. This is how git cli runs it. It is annoying to type in a commit message for a commit that pre-commit is going to reject anyway
This is not easy to fix though. The way the user gets to choose to skip the validation by the 2 hooks that are allowed to veto a commit is by entering ^f in the commit dialog. Thats too late to bypass the pre-commit check if its run before the UI is shown
solutions
The text was updated successfully, but these errors were encountered: