From 901d9ab7629f0ac984349ec6ee70441feec7bbb6 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Fri, 21 May 2010 15:56:40 +0200 Subject: [PATCH] add post-receive hook Signed-off-by: martin f. krafft --- post-receive-hook.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 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 -- 2.39.5