Skip to content

pre-commit hook for merges

Michael J Gruber git 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 0 repliesNew

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4merge: document prepare-commit-msg hook usageDocumentation/git-merge.txt Documentation/githooks.txt+7 -00 replies
2/4git-merge: Honor pre-commit hook based on configDocumentation/git-merge.txt Documentation/githooks.txt Documentation/merge-config.txt +1 more+25 -20 replies
3/4merge: --no-verify to bypass pre-commit hookDocumentation/git-merge.txt Documentation/githooks.txt Documentation/merge-options.txt +1 more+9 -20 replies
4/4t7503: add tests for pre-commit hook (merge)t/t7503-pre-commit-hook.sh+62 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCHv2 0/4] pre-commit hook for merges

In this second iteration I implement Junio's suggestion: 'git merge' invokes the pre-commit hook when merge.usePreCommitHook is set to true.

1/4 documents that 'git merge' invokes the prepare-commit-msg hook unconditionally already.

2-4 are v2 of the previous 1-3.

This leaves aside the issue of commit-msg and post-commit hooks. If we can live with a bit of incompatibility I would rename the config to merge.useCommitHooks and call all of them based on that. This would change the way prepare-commit-msg is treated now.

We could also introduce 4 config variables, 3 defaulting to false, 1 to true, of course...

[I had messed up my alias file when adding mhagger, and it seems that tripped up vger; resending, sorry.]

Michael J Gruber (4):
merge: document prepare-commit-msg hook usage
git-merge: Honor pre-commit hook based on config
merge: --no-verify to bypass pre-commit hook
t7503: add tests for pre-commit hook (merge)

 Documentation/git-merge.txt     |  7 ++++-
 Documentation/githooks.txt      |  6 ++++
 Documentation/merge-config.txt  |  5 ++++
 Documentation/merge-options.txt |  4 +++
 builtin/merge.c                 | 19 ++++++++++++-
 t/t7503-pre-commit-hook.sh      | 62 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 101 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.12.406.gafd3f81