执行git revert时,将显示带有默认消息“ Revert'originalMsg'”的提交消息编辑器。我想在用户编辑默认还原消息后触发一个挂接。但是,好像here所述,git revert似乎仅触发pre-commit-msg和post-commit钩子。
对我来说,将消息检查钩子放入pre-commit-msg还为时过早,在提交编辑器关闭并且用户保存新消息后,我需要触发钩子。
steps:
1. git revert commit_id
2. pre-commit-msg hook is triggered >>> **too early to put here my checks**
3. editor commit msg
4. close editor msg >> **after close I need to triger check-msg HOOK**
5. post-commit hook is triggered