[PATCH] Add post-merge hook.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Josh England <jjengla@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 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


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux