From 0e1e4483dab9153ec4c710dd71176317f231c0fa Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Mon, 12 Oct 2009 02:16:28 -0400 Subject: [PATCH] Since the zephyr-post-receive is only being used in the submodule, there's no need to mess around with symlinks. svn path=/trunk/scripts/git-hooks/; revision=2501 --- sub/zephyr-post-receive | 42 +++++++++++++++++++++++++++++++++++++++++- zephyr-post-receive | 41 ----------------------------------------- 2 files changed, 41 insertions(+), 42 deletions(-) mode change 120000 => 100755 sub/zephyr-post-receive delete mode 100755 zephyr-post-receive diff --git a/sub/zephyr-post-receive b/sub/zephyr-post-receive deleted file mode 120000 index eb677d1..0000000 --- a/sub/zephyr-post-receive +++ /dev/null @@ -1 +0,0 @@ -../zephyr-post-receive \ No newline at end of file diff --git a/sub/zephyr-post-receive b/sub/zephyr-post-receive new file mode 100755 index 0000000..7e06b30 --- /dev/null +++ b/sub/zephyr-post-receive @@ -0,0 +1,41 @@ +#!/bin/sh +# +# This script is run after receive-pack has accepted a pack and the +# repository has been updated. It is passed arguments in through stdin +# in the form +# +# For example: +# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master + +class=`git config zephyr.class` +instance=`git config zephyr.instance` +zsig=`git config zephyr.zsig` +color=`git config --bool zephyr.color` + +if [ "${color:-true}" = "true" ]; then + usecolor="--color" +else + usecolor="" +fi + +if [ -z "$class" ]; then + echo "I don't know where to send a commit zephyr!" >&2 + echo "Please set the zephyr.class config variable in" >&2 + echo "$PWD/config." >&2 + exit 1 +fi +while read oldrev newrev refname; do + git-rev-list --reverse "$oldrev..$newrev" | while read rev; do + shortrev=`git log -1 --pretty=format:%h "$rev"` + (git show --stat $usecolor "$rev" | + sed -e 's/@/@@/g' \ + -e 's/}/@(})/g' \ + -e 's/\[m/}@{/g' \ + -e 's/\[33m/@color(yellow)/g' \ + -e 's/\[31m/@color(red)/g' \ + -e 's/\[32m/@color(green)/g' \ + -e '1s/^/@{/' \ + -e '$s/$/}/') | + zwrite -c "$class" -i "${instance:-$shortrev}" -s "${zsig:-Git}: $refname" -d + done +done diff --git a/zephyr-post-receive b/zephyr-post-receive deleted file mode 100755 index 7e06b30..0000000 --- a/zephyr-post-receive +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# -# This script is run after receive-pack has accepted a pack and the -# repository has been updated. It is passed arguments in through stdin -# in the form -# -# For example: -# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master - -class=`git config zephyr.class` -instance=`git config zephyr.instance` -zsig=`git config zephyr.zsig` -color=`git config --bool zephyr.color` - -if [ "${color:-true}" = "true" ]; then - usecolor="--color" -else - usecolor="" -fi - -if [ -z "$class" ]; then - echo "I don't know where to send a commit zephyr!" >&2 - echo "Please set the zephyr.class config variable in" >&2 - echo "$PWD/config." >&2 - exit 1 -fi -while read oldrev newrev refname; do - git-rev-list --reverse "$oldrev..$newrev" | while read rev; do - shortrev=`git log -1 --pretty=format:%h "$rev"` - (git show --stat $usecolor "$rev" | - sed -e 's/@/@@/g' \ - -e 's/}/@(})/g' \ - -e 's/\[m/}@{/g' \ - -e 's/\[33m/@color(yellow)/g' \ - -e 's/\[31m/@color(red)/g' \ - -e 's/\[32m/@color(green)/g' \ - -e '1s/^/@{/' \ - -e '$s/$/}/') | - zwrite -c "$class" -i "${instance:-$shortrev}" -s "${zsig:-Git}: $refname" -d - done -done -- 1.7.9.5