From b96a91bc2b8280400afb6b683b6d64b46a121264 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 9 Nov 2023 21:43:05 +0000 Subject: put hook script in here too --- post-recieve.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 post-recieve.sh (limited to 'post-recieve.sh') diff --git a/post-recieve.sh b/post-recieve.sh new file mode 100644 index 0000000..5bda671 --- /dev/null +++ b/post-recieve.sh @@ -0,0 +1,12 @@ +#!/bin/sh +reponame=$(basename $(git rev-parse --absolute-git-dir) .git) +while read old new ref; do + ccount=$(git rev-list "$new" ^"$old" | wc -l) + s="s" + [ "$ccount" -eq 1 ] && s= + echo "$reponame: $ref: $ccount commit$s (https://g.gh0.pw/${reponame}/)" + git log --format='format: %h %an - %s' "$new" ^"$old" | sed -e '$a\' +done | while IFS= read line; do + echo "$line" | nc -Uu -q0 /srv/apiobot/ch/a.sock + echo "$line" +done -- cgit v1.2.3