I have implemented a commit hook to check the commit message and abort the commit if the message isn't formatted correctly. I've done this with the commit-msg
hook.
However, this will only work if you commit with the -m
flag. If you omit that flag (because you want to use your editor to add the message), then the commit hook will fail (no message).
From what I have read, both the pre-commit
and commit-msg
hook are fired before the editor is opened. Is there a way to do something similar that waits for the editor to be closed?