summaryrefslogtreecommitdiffstats
path: root/crawl-ref/git-hooks/update
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-01 20:24:41 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-01 20:24:41 -0800
commit9683d9d03bd07ca4fdf46549fc662c06870c4227 (patch)
treed0acf0148322d5af877d72e8a55a10d4b0634a37 /crawl-ref/git-hooks/update
parent60df59bb213b7c2c3c6bc69ac9c87d28378db1ff (diff)
downloadcrawl-ref-9683d9d03bd07ca4fdf46549fc662c06870c4227.tar.gz
crawl-ref-9683d9d03bd07ca4fdf46549fc662c06870c4227.zip
Information on our git-hooks
Local copies of the git hooks, plus intructions on how to change them.
Diffstat (limited to 'crawl-ref/git-hooks/update')
-rwxr-xr-xcrawl-ref/git-hooks/update19
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/git-hooks/update b/crawl-ref/git-hooks/update
new file mode 100755
index 0000000000..a38deb2499
--- /dev/null
+++ b/crawl-ref/git-hooks/update
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Note that you can (and it might be actually more desirable) also use this
+# script as the GIT update hook:
+#
+
+GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
+if [ -z "$GIT_DIR" ]; then
+ echo >&2 "fatal: post-receive: GIT_DIR not set"
+ exit 1
+fi
+
+refname=${1#refs/heads/}
+[ "$refname" = "master" ] && refname=
+oldhead=$2
+newhead=$3
+for merged in $(git-rev-list $newhead ^$oldhead | tac); do
+ $GIT_DIR/hooks/crawl-ref-cia $merged $refname
+done