From 20f35b21a518fb7cf672aa890cd8d947f4c019dd Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Thu, 19 Jun 2008 17:48:59 -0500 Subject: [PATCH] Move the trac hook around to parallelize with post-receive-email. --- server/post-receive | 13 +++++++++++++ server/post-receive-trac | 18 ++++++++++++++++++ trac-post-commit-hook.sh | 19 ------------------- 3 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 server/post-receive create mode 100644 server/post-receive-trac delete mode 100644 trac-post-commit-hook.sh diff --git a/server/post-receive b/server/post-receive new file mode 100644 index 0000000..80e3465 --- /dev/null +++ b/server/post-receive @@ -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 index 0000000..fc8d0e1 --- /dev/null +++ b/server/post-receive-trac @@ -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 index 0adb086..0000000 --- a/trac-post-commit-hook.sh +++ /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 -- 2.39.5