From c8732b1dfd07e8c8bae49f6bc575a73235d5c0ab Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 26 Mar 2010 10:41:22 -0400 Subject: Add files display to CIA hook. --- repo/hooks/ciabot.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'repo') diff --git a/repo/hooks/ciabot.sh b/repo/hooks/ciabot.sh index 8755e0dc..806ba5d8 100755 --- a/repo/hooks/ciabot.sh +++ b/repo/hooks/ciabot.sh @@ -5,7 +5,7 @@ # Copyright (c) 2010 Eric S. Raymond # # Git CIA bot in bash. (no, not the POSIX shell, bash). -# It is *heavily* based on Git ciabot.pl by Petr Baudis. +# Originally based on Git ciabot.pl by Petr Baudis. # This script contains porcelain and porcelain byproducts. # # It is meant to be run either on a post-commit hook or in an update @@ -56,9 +56,14 @@ else merged=$2 fi -url=$(wget -O - -q http://tinyurl.com/api-create.php?url=${urlprefix}${merged} 2>/dev/null) +# This tries to turn your gitwebbish URL into a tinyurl so it will take up +# less space on the IRC notification line. Some repo sites (I'm looking at +# you, berlios.de!) forbid wget calls for security reasons. On these, +# the code will fall back to the full un-tinyfied URL. +longurl=${urlprefix}${merged} +url=$(wget -O - -q http://tinyurl.com/api-create.php?url=${longurl} 2>/dev/null) if [ -z "$url" ]; then - url="${urlprefix}${merged}" + url="${longurl}" fi refname=${refname##refs/heads/} @@ -75,13 +80,6 @@ logmessage=$(echo "$rawcommit" | sed -e '1,/^$/d' | head -n 1) logmessage=$(echo "$logmessage" | sed 's/\&/&\;/g; s//>\;/g') ts=$(echo "$rawcommit" | sed -n -e '/^author .*> \([0-9]\+\).*$/s--\1-p') -# -# -# -# $(git diff-tree -r --name-only ${merged} | -# sed -e '1d' -e 's-.*-&-') -# - out=" @@ -98,6 +96,10 @@ out=" ${author} ${rev} + + $(git diff-tree -r --name-only ${merged} | + sed -e '1d' -e 's-.*-&-') + ${logmessage} ${url} ${url} -- cgit v1.2.1