]> git.ipfire.org Git - thirdparty/git.git/commit - Documentation/githooks.txt
git-merge: honor pre-merge-commit hook
authorMichael J Gruber <git@drmicha.warpmail.net>
Wed, 7 Aug 2019 18:57:07 +0000 (11:57 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Aug 2019 19:37:33 +0000 (12:37 -0700)
commit6098817fd7f64209664c701df30096dc0f4fb876
treebda0487dbaa09b8f8f53021784ce2087bd348914
parenta1f3dd7eb303d924f90da30808f7702869430321
git-merge: honor pre-merge-commit hook

git-merge does not honor the pre-commit hook when doing automatic merge
commits, and for compatibility reasons this is going to stay.

Introduce a pre-merge-commit hook which is called for an automatic merge
commit just like pre-commit is called for a non-automatic merge commit
(or any other commit).

[js: * renamed hook from "pre-merge" to "pre-merge-commit"
     * only discard the index if the hook is actually present
     * expanded githooks documentation entry
     * clarified that hook should write messages to stderr
     * squashed test changes from the original series' patch 4/4
     * modified tests to follow new pattern from this series' patch 1/4
     * added a test case for non-executable merge hooks
     * added a test case for failed merges
     * when testing that the merge hook did not run, make sure we
       actually have a merge to perform (by resetting the "side" branch
       to its original state).
     * reworded commit message
]

Improved-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/githooks.txt
builtin/merge.c
t/t7503-pre-commit-and-pre-merge-commit-hooks.sh [moved from t/t7503-pre-commit-hook.sh with 63% similarity]
templates/hooks--pre-merge-commit.sample [new file with mode: 0755]