X-Git-Url: https://git.ctpug.org.za/?p=gitolite-hooks.git;a=blobdiff_plain;f=slack;h=ac6e1143f7cc8e5a79fe9d74235c7860dedcbc6f;hp=45187cfe5b92ecd069760d374cc161d4f227fadb;hb=ceceb3aa1d5209d2015a2acb55486ce70436e2a6;hpb=be0a5404034731b70a08addaa0f96b53e3d1b7d3 diff --git a/slack b/slack index 45187cf..ac6e114 100755 --- a/slack +++ b/slack @@ -8,7 +8,7 @@ # Based on post-receive.irc by Mikael Fridh https://gist.github.com/1821358 # -function help() { +function help_slack() { echo "Required config settings:" echo " git config hooks.slack.webhook-url 'https://hooks.slack.com/services/...'" echo " git config hooks.slack.channel 'general'" @@ -22,6 +22,9 @@ function notify_slack() { newrev=$(git rev-parse $2) refname="$3" + echo "slack $1 $2 $3" + return + # --- Interpret # 0000->1234 (create) # 1234->2345 (update) @@ -233,16 +236,3 @@ function notify_slack() { "$webhook_url" \ >/dev/null } - -webhook_url=$(git config --get hooks.slack.webhook-url) - -while read line; do - set -- $line - if [ -n "$webhook_url" ]; then - notify_slack $* - fi - - RET=$? -done - -exit $RET