]> git.droids-corp.org - git-central.git/commitdiff
Move the trac hook around to parallelize with post-receive-email.
authorStephen Haberman <stephen@exigencecorp.com>
Thu, 19 Jun 2008 22:48:59 +0000 (17:48 -0500)
committerStephen Haberman <stephen@exigencecorp.com>
Thu, 19 Jun 2008 22:48:59 +0000 (17:48 -0500)
server/post-receive [new file with mode: 0644]
server/post-receive-trac [new file with mode: 0644]
trac-post-commit-hook.sh [deleted file]

diff --git a/server/post-receive b/server/post-receive
new file mode 100644 (file)
index 0000000..80e3465
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# Delegates to post-receive-email and post-receive-trac
+#
+
+input=""
+while read line ; do
+    input="$input$line"
+done
+
+echo $input | sh hooks/post-receive-email
+echo $input | sh hooks/post-receive-trac
+
diff --git a/server/post-receive-trac b/server/post-receive-trac
new file mode 100644 (file)
index 0000000..fc8d0e1
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+export LD_LIBRARY_PATH=/home/BIPFS/shaberman/local/lib
+TRAC_ENV=/srv/trac/cbas
+
+while read oldrev newrev refname ; do
+       if expr "$oldrev" : '0*$' >/dev/null
+       then
+               git rev-parse --not --branches | grep -v $(git rev-parse $refname) | git rev-list --stdin $newrev
+       else
+               git rev-parse --not --branches | grep -v $(git rev-parse $refname) | git rev-list --stdin $oldrev..$newrev
+       fi | while read com ; do
+               /home/BIPFS/shaberman/local/bin/python /srv/git/hooks/trac-post-commit-hook.py -p "$TRAC_ENV" -r "$com"
+       done
+done
+
+exit 0
+
diff --git a/trac-post-commit-hook.sh b/trac-post-commit-hook.sh
deleted file mode 100644 (file)
index 0adb086..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-export LD_LIBRARY_PATH=/home/BIPFS/shaberman/local/lib
-TRAC_ENV=/srv/trac/cbas
-
-while read oldrev newrev refname ; do
-    if expr "$oldrev" : '0*$' >/dev/null
-    then
-        # git-rev-list "$newrev"
-        git rev-parse --not --branches | grep -v $(git rev-parse $refname) | git rev-list --stdin $newrev
-    else
-        # git-rev-list "$newrev" "^$oldrev"
-               git rev-parse --not --branches | grep -v $(git rev-parse $refname) | git rev-list --stdin $oldrev..$newrev
-    fi | while read com ; do
-        /home/BIPFS/shaberman/local/bin/python /srv/git/hooks/trac-post-commit-hook.py -p "$TRAC_ENV" -r "$com" 
-    done
-done
-
-exit 0