From: Sam Vilain <hidden> Date: 2016-06-15 22:43:20
git-merge.sh was not running the commit hooks, so run them in the two
places where we go to commit.
Signed-off-by: Sam Vilain <redacted>
---
Not sure if it should call these or some specialist hooks, like
git-am does.
git-merge.sh | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
@@ -440,8 +465,10 @@ doneiftest''!="$result_tree"thenparents=$(git-show-branch--independent"$head""$@"|sed-e's/^/-p /')+merge_msg=$(call_pre_hooks"$merge_msg")result_commit=$(printf'%s\n'"$merge_msg"|git-commit-tree$result_tree$parents)||exitfinish"$result_commit""Merge made by $wt_strategy."+call_post_hookdropsaveexit0fi
From: Junio C Hamano <hidden> Date: 2016-06-15 22:43:20
Sam Vilain [off-list ref] writes:
git-merge.sh was not running the commit hooks, so run them in the two
places where we go to commit.
Signed-off-by: Sam Vilain <redacted>
---
Not sure if it should call these or some specialist hooks, like
git-am does.
I suspect some people have pre-commit scripts that have been
meant to catch style errors for their own commits, and invoking
that on merge would wreak havoc --- there is not much you can do
if you want to get the work done by somebody else at that point.
Introducing a new pre-merge-commit hook would probably be safer;
if one wants to use the same check as one's pre-commit does, the
new hook in the repository can exec $GIT_DIR/hooks/pre-commit.
The commit-msg hook I have no clue what people usually use it
for in the real world, but a merge commit message tends to be
quite different from the message you would give to your own
straight line commits, so custom reformatting rules people have
in commit-msg hook may not apply to merge commit messages.
Same for post-commit, but probably to lessor extent, as I
suspect people use that mostly for per-commit notification
mechanism.
From: Sam Vilain <hidden> Date: 2016-06-15 22:43:20
Junio C Hamano wrote:
Sam Vilain [off-list ref] writes:
quoted
git-merge.sh was not running the commit hooks, so run them in the two
places where we go to commit.
Signed-off-by: Sam Vilain <redacted>
---
Not sure if it should call these or some specialist hooks, like
git-am does.
I suspect some people have pre-commit scripts that have been
meant to catch style errors for their own commits, and invoking
that on merge would wreak havoc --- there is not much you can do
if you want to get the work done by somebody else at that point.
Introducing a new pre-merge-commit hook would probably be safer;
if one wants to use the same check as one's pre-commit does, the
new hook in the repository can exec $GIT_DIR/hooks/pre-commit.
The commit-msg hook I have no clue what people usually use it
for in the real world, but a merge commit message tends to be
quite different from the message you would give to your own
straight line commits, so custom reformatting rules people have
in commit-msg hook may not apply to merge commit messages.
True. OTOH, if you commit with `git commit` after a merge which failed
or was called with --no-commit, then it will call the commit hook. So
those scripts would have to deal with that case anyway.
So, should `git commit` detect it is committing a merge and call the
merge-hooks, should we use the same hooks, or, should this be something
like hooks/*-automerge ?
Sam.
From: Andy Parkins <hidden> Date: 2016-06-15 22:43:20
On Wednesday 2007 July 11, Junio C Hamano wrote:
The commit-msg hook I have no clue what people usually use it
for in the real world, but a merge commit message tends to be
I use it for adding my Signed-Off-By automatically in my git repository. Of
course that's only valid for the likes of me because I can be sure that I
only ever commit my own patches, rather than integrating other people's.
Andy
--
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com