post-receive-hook: Send also project name
[girocco/testingthisout.git] / post-receive-hook
blob12acde8bd64c7bc7708e51502745523b30022b5b
1 #!/bin/sh
3 # Send notification through the taskd socket
5 # Beware, we MAY be running in a chroot!
7 set -e
9 sockpath=/etc/taskd.socket
10 cwd="$(pwd)"
11 if [ -x /usr/bin/perl ]; then
12 # Not in chroot...
13 . @basedir@/shlib.sh
15 sockpath="$cfg_chroot/$sockpath"
16 projname="${cwd#$cfg_reporoot/}"
17 else
18 projname="${cwd#/srv/git/}"
21 [ -S "$sockpath" ] || exit 0
23 while read line; do
24 echo "ref-change $projname $line"
25 done | /bin/nc.openbsd -w 1 -U "$sockpath"
27 exit