X-Git-Url: https://git.madduck.net/code/fbi-announce.git/blobdiff_plain/2b20f344a8dab1197704d05fdb178b07838f8c7e..901d9ab7629f0ac984349ec6ee70441feec7bbb6:/post-receive-hook.sh 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