aboutsummaryrefslogtreecommitdiff
path: root/post-recieve.sh
diff options
context:
space:
mode:
Diffstat (limited to 'post-recieve.sh')
-rw-r--r--post-recieve.sh12
1 files changed, 12 insertions, 0 deletions
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