2011-11-07 15:41:43 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#
|
2011-11-16 11:20:24 +00:00
|
|
|
# This Git hook sends update message to a notification server, so
|
|
|
|
# that manual git pushes to a repository also will be noticed by
|
|
|
|
# SparkleShare clients.
|
|
|
|
#
|
|
|
|
# For information on running your own notification service:
|
|
|
|
# https://github.com/hbons/fanout.node.js
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# For use with Gitolite:
|
|
|
|
#
|
|
|
|
# Copy this file to .gitolite/hooks/common/post-update.
|
|
|
|
# Run "gl-setup" again.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# For use with standard Git repositories:
|
|
|
|
#
|
|
|
|
# Copy this file to .git/hooks/post-update in
|
|
|
|
# the remote repository
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Make sure to "chmod -x" this hook after the file has been copied
|
2011-11-07 15:41:43 +00:00
|
|
|
#
|
|
|
|
|
2011-11-16 11:20:24 +00:00
|
|
|
# Change these if you run your own service somewhere
|
|
|
|
SERVER = "notifications.sparkleshare.org"
|
|
|
|
PORT = "1986"
|
2011-11-07 15:41:43 +00:00
|
|
|
|
2011-11-16 11:20:24 +00:00
|
|
|
# Don't edit below this line
|
2011-11-07 15:41:43 +00:00
|
|
|
exec > /dev/null 2>&1
|
|
|
|
|
2011-11-16 11:20:24 +00:00
|
|
|
CHANNEL = $(git rev-list --reverse HEAD | head -n 1)
|
|
|
|
MESSAGE = $(git rev-list HEAD | head -n 1)
|
|
|
|
|
|
|
|
DATA = "announce ${CHANNEL} ${MESSAGE}"
|
2011-11-07 15:41:43 +00:00
|
|
|
echo "${DATA}\n" | socat - TCP-CONNECT:${SERVER}:${PORT} &
|
|
|
|
|
|
|
|
exit 0
|