Skip to content

pre-merge hook

Michael J Gruber git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4git-merge: Honor pre-merge hookDocumentation/githooks.txt builtin/merge.c templates/hooks--pre-merge.sample+31 -02 replies
2/4merge: do no-verify like commitbuiltin/merge.c+3 -31 reply
3/4merge: --no-verify to bypass pre-merge hookDocumentation/git-merge.txt Documentation/githooks.txt Documentation/merge-options.txt +1 more+8 -42 replies
4/4t7503: add tests for pre-merge-hookt/t7503-pre-commit-hook.sh+65 -11 reply

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by.

PatchMartin Ågren
SeriesImproved-by Improved-by Improved-by Improved-by Improved-by Improved-by
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] pre-merge hook

Now that f8b863598c ("builtin/merge: honor commit-msg hook for merges", 2017-09-07) has landed, merge is getting closer to behaving like commit, which is important because both are used to complete merges (automatic vs. non-automatic).

This series revives an old suggestion of mine to make merge honor pre-commit hook or a separate pre-merge hook. Since pre-commit does not receive any arguments (which the hook could use tell between commit and merge) and in order to keep existing behaviour (as opposed to the other patch) this series introduces a pre-merge hook, with a sample hook that simply calls the pre-commit hook.

commit and merge have very similar code paths. f8b863598c implemented "--no-verify" for merge differently from the existing implementation in commit. 2/4 changes that and could be first in this series, with the remaining 3 squashed into 2 commits or 1. I've been rebasing and using this series for years now, 2/4 is the new-comer which fixed the breakage from f8b863598c that I encountered because of the no-verify implementation.

Michael J Gruber (4):
git-merge: Honor pre-merge hook
merge: do no-verify like commit
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                   | 17 ++++++++--
 t/t7503-pre-commit-hook.sh        | 66 ++++++++++++++++++++++++++++++++++++++-
 templates/hooks--pre-merge.sample | 13 ++++++++
 6 files changed, 104 insertions(+), 5 deletions(-)
 create mode 100755 templates/hooks--pre-merge.sample
Signature · 1 line
2.14.1.909.g0fa57a0913