git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add post-merge hook.
@ 2007-08-30 22:40 jjengla
  2007-08-30 23:07 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: jjengla @ 2007-08-30 22:40 UTC (permalink / raw)
  To: git; +Cc: Josh England

From: Josh England <jjengla@sandia.gov>

This adds a post-merge hook that will run after `git pull` operations
if enabled.  The hook is passed no arguments and cannot affect the
outcome of a merge.

Signed-off-by: Josh England <jjengla@sandia.gov>
---
 Documentation/hooks.txt |    8 ++++++++
 git-merge.sh            |    6 ++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/Documentation/hooks.txt b/Documentation/hooks.txt
index c39edc5..841b37f 100644
--- a/Documentation/hooks.txt
+++ b/Documentation/hooks.txt
@@ -87,6 +87,14 @@ parameter, and is invoked after a commit is made.
 This hook is meant primarily for notification, and cannot affect
 the outcome of `git-commit`.
 
+post-merge
+-----------
+
+This hook is invoked by `git-merge`, which happens when a `git pull`
+is done on a local repository.
+
+The hook takes no parameters, and cannot affect the outcome of `git-merge`.
+
 [[pre-receive]]
 pre-receive
 -----------
diff --git a/git-merge.sh b/git-merge.sh
index 3a01db0..0a77bfb 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -97,6 +97,12 @@ finish () {
 		fi
 		;;
 	esac
+
+	# Run a post-merge hook
+        if test -x "$GIT_DIR"/hooks/post-merge
+        then
+                "$GIT_DIR"/hooks/post-merge
+        fi
 }
 
 merge_name () {
-- 
1.5.3.rc7-dirty

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-09-04 21:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-30 22:40 [PATCH] Add post-merge hook jjengla
2007-08-30 23:07 ` Junio C Hamano
2007-09-04 16:25   ` Josh England
2007-09-04 17:25     ` Junio C Hamano
2007-09-04 19:36       ` Josh England
2007-09-04 20:03         ` Junio C Hamano
2007-09-04 20:32           ` Josh England
2007-09-04 20:52             ` Steven Grimm
2007-09-04 21:23               ` Josh England

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).