From: martin f. krafft Date: Fri, 21 May 2010 13:56:40 +0000 (+0200) Subject: add post-receive hook X-Git-Url: https://git.madduck.net/code/fbi-announce.git/commitdiff_plain/901d9ab7629f0ac984349ec6ee70441feec7bbb6?ds=inline add post-receive hook Signed-off-by: martin f. krafft --- diff --git a/post-receive-hook.sh b/post-receive-hook.sh new file mode 100755 index 0000000..b9b7d29 --- /dev/null +++ b/post-receive-hook.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# post-receive-hook — a post-receive hook to invoke fbi-announce +# +# Copyright © 2009–2010 martin f. krafft +# +# Distributed under the terms of the Artistic Licence 2.0 +# +set -eu + +refname=$3 +rev=$(git rev-parse ${refname}) +oldhead=$1 +newhead=$2 + +realself=$(readlink -f ${0}) +siblingscript="${realself%/*}/fbi-announce.sh" + +for commit in $(git rev-parse --not --branches | grep -v ${rev} | + git rev-list --reverse --stdin ${oldhead}..${newhead}); do + ${siblingscript} ${refname} ${commit} +done