Created
January 25, 2011 21:09
-
-
Save rsdy/795671 to your computer and use it in GitHub Desktop.
git post-receive hook to post the last commit message and committer onto an irc channel through irssi-proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
USER='username' | |
PASS='password' # password for the irc server or irssi-proxy | |
PORT=6668 # port where irssi-proxy runs | |
HOST='localhost' # host where irssi-proxy runs | |
CHAN='#test' # channel in which to post | |
read oldrev newrev _branch | |
branch=$(echo $_branch | sed 's/.*\/\([a-z0-9][a-z0-9]*\)$/\1/') | |
tail=$(git log -1 --pretty=format:'%h %cn: %s%b' $newrev) | |
nc $HOST $PORT > /dev/null << EOF | |
pass $PASS | |
user $USER | |
nick $USER | |
privmsg $CHAN :$branch - $tail | |
quit | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment