aboutsummaryrefslogtreecommitdiff
path: root/post-recieve.sh
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-11-09 21:43:05 +0000
committerubq323 <ubq323@ubq323.website>2023-11-09 21:43:05 +0000
commitb96a91bc2b8280400afb6b683b6d64b46a121264 (patch)
treeae7cc96d4bacaa1607bd87f4a303c0aeaa6f9eea /post-recieve.sh
parentb34e389a1c04ceac25352b0d265972449a3168a2 (diff)
put hook script in here tooHEADmaster
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