Version 8

git irc bot post-commit script

Tutorial on creating a script to post commits to a IRC channel

Created by: spiderr, Last modification: 12 May 2011 (15:20 UTC) by spiderr
After doing much digging around for the git equivalent of the svn irc bot, a kind stranger on told me about the ii irc client.

What is so great about this solution is there is NO dependency hell like java groovy IRC framework. Just a very small single binary application. Just install the little app, and config some files, no script needed.

  1. Download, compile, and install the ii irc bot
  2. Have ii start up on boot and join your desired channel. When ii starts up, it will create directories and pipe files in the current working directory. For example, if you run ii as the git user in /home/git, you can add this to your /etc/rc.local:
    su -c "ii -s" - git
    echo "/j #foobar" > /home/git/irc/
  3. Edit your post-receive or post-commit in repo.git/hooks (or repo/.git/hooks) depending on how you want to setup your notifications. Be sure to chmod with proper exec perms (e.g. 770 or ug+x). Example post-receive:
    echo "---- git `hostname` push received ----" > /home/git/irc/#foobar/in
    git log -1 --name-status > /home/git/irc/
Page History
12 May 2011 (15:53 UTC)
Current • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source