Using strace, I noticed that git-revert only calls two hooks:
- prepare commit messages
- after fixation
But git-commit will call these four:
- before fixing
- prepare commit messages
- commit-message
- after fixation
Since git-revert creates a commit, why doesn't it call the same hooks as git-commit?
I asked this on the Git mailing list but did not receive a response. Therefore, I ask here.
I ended up researching this when I implemented a hook to detect and deny commits that return merge-commits because they are
problematic .
I tried to implement it as a commit-msg hook to search for the string "This returns SHA-1" in the commit message. But git-revert does not call hook-commit-msg.
, .
,
pre-commit commit-msg,
, .