Re: [RFC/PATCH] merge: honor prepare-commit-msg hook
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 22, 2010, 00:14 UTC
- Message-ID
- <7vsk3cgyob.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1279600144-89629-1-git-send-email-jaysoffian@gmail.com>
Jay Soffian <jaysoffian@gmail.com> writes:
> --- > I couldn't figure out why my prepare-commit-msg wasn't being honored > by git merge.
It has been that way from day one, it appears.
The bypassing of pre-commit hook was and remains to be a conscious design decision. When you are pulling from your contributors who may have objectionable contents that you have to merge, the damage is already done; you _could_ yell at them to fix their branch and re-pull in theory, but that wouldn't work very well in practice.
On the other hand, I think letting people use prepare-commit-msg for merges might make sense. Indeed, "git commit" is prepared to call prepare-commit-msg telling the hook that it is concluding a merge, when your "git merge" stopped due to a conflict (or you stopped it from making a new commit with --no-commit).
I don't know about the other hooks "git commit" normally calls. Both "commit-msg" and "post-commit" may make sense, but I don't care too deeply either way---I don't care too deeply for pre-commit either ;-).