From: Alex Dehnert Date: Sat, 2 Feb 2013 23:59:17 +0000 (-0500) Subject: zephyr-post-receive: fix quoting and tabs X-Git-Url: https://snippets.scripts.mit.edu/gitweb.cgi/Scripts/git/.git/commitdiff_plain/0a6422ec6a30429215c4a93dd5a40799712c09b0 zephyr-post-receive: fix quoting and tabs --- diff --git a/git-hooks/zephyr-post-receive b/git-hooks/zephyr-post-receive index d0c6f44..6feebad 100755 --- a/git-hooks/zephyr-post-receive +++ b/git-hooks/zephyr-post-receive @@ -61,15 +61,16 @@ while read oldrev newrev refname; do check_max shortrev=`git log -1 --pretty=format:%h "$rev"` lines=`git show -M "$rev" | wc -l` - cmd="git show --stat -M $usecolor $rev" if [ $lines -lt $maxlines ]; then - cmd="git show -M $usecolor $rev" + stat="" + else + stat="--stat" fi - ($cmd | + (git show -M $stat $usecolor "$rev" | sed -e 's/@/@@/g' \ -e 's/}/@(})/g' \ -e 's/\[m/}@{/g' \ - -e 's/\[1m/}@b{/g' \ + -e 's/\[1m/}@b{/g' \ -e 's/\[33m/@color(yellow)/g' \ -e 's/\[31m/@color(red)/g' \ -e 's/\[32m/@color(green)/g' \