The pre-commit hook is often used to ensure certain properties of each comitted tree like formatting or coding standards, validity (lint/make) or code quality (make test). But merges introduce new commits unless they are fast forwards, and therefore they can break these properties because the pre-commit hook is not run by "git merge".
Introduce a pre-merge hook which works for (non ff, automatic) merges like pre-commit does for commits. Typically this will just call the pre-commit hook (like in the sample hook), but it does not need to. Michael J Gruber (3): git-merge: Honor pre-merge hook merge: --no-verify to bypass pre-merge hook t7503: add tests for pre-merge-hook Documentation/git-merge.txt | 2 +- Documentation/githooks.txt | 7 +++++ Documentation/merge-options.txt | 4 +++ builtin/merge.c | 15 ++++++++- t/t7503-pre-commit-hook.sh | 66 ++++++++++++++++++++++++++++++++++++++- templates/hooks--pre-merge.sample | 13 ++++++++ 6 files changed, 104 insertions(+), 3 deletions(-) create mode 100755 templates/hooks--pre-merge.sample -- 188.8.131.526.gafd3f81 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html