Run diff-scoped pre-commit checks on a merge before committing it: git merge --no-commit --no-ff
Check scripts that pick what to run from git diff --name-only HEAD select nothing after a merge commit, because the merged tree equals HEAD. To check the merged result before it exists as a commit, run git merge --no-commit --no-ff <branch>: the incoming changes are staged, so git diff --name-only HEAD lists them and the checks run on exactly the tree you are about to commit. Resolve conflicts, git add them, run the checks, then git commit. If they fail, git merge --abort puts the branch back. Two caveats: a fast-forward never stops for checks unless you pass --no-ff, and if each merged branch adds tests to the same test target, a build-only check can pass while the combined tests were never run together. Run the full test target once on the combined tree.