Skip to content

Instantly share code, notes, and snippets.

@rsdy
Created January 25, 2011 21:09
Show Gist options
  • Save rsdy/795671 to your computer and use it in GitHub Desktop.
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
#!/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