SvnBot 1.1 Released

The SvnBot is a simple single purpose IRC robot that monitors one or more SVN repositories. When changes are committed to a source repository the robot makes an announcement in an IRC channel. The purpose of the tool is to allow a team of developers to keep up to date on changes that other team members are making. Here at TDL we have a geographically distributed team of software developers some in Austin and Lubbock along with my self in College Station. This is one tool that helps the team keep in sync with each other.

There are already many tools available that do this task [1][2][3], however they all require the use of SVN commit-hooks. Commit-hooks are run on the repository’s server allowing external tools to be notified when specific events occur. Using commit-hooks can work reasonably well if you have access to the server’s configuration, but that is not always the case. Instead of relying on commit-hooks; the SvnBot runs independently, periodically polling the repository for any updates. When an update in found a message will be announced in IRC.

Below is an example IRC message. The message includes the author and their commit message along with some brief statistics about the number of files affected and a URL. If multiple files were affected by a single commit then the url reported is to the common path, i.e. the closest directory that contains all the affected files.

Scott: “SAND-30, reviewed the pom file: removing unneeded dependencies, declaring output to be UTF-8 and added a few comments.(Rev 666: 1 file modified)

Special thanks to the Texas Digital Library, my employer, for allowing me to release this as an open source project.


How to use

From the binary distribution simply run the Java jar file with the “-c” parameter passing the path to a configuration file. An example configuration file is provided with the with both the binary and source distributions.

java –jar svnbot-1.1-jar-with-dependencies.jar –c path/to/config

Since many will want to deploy SvnBot on a server and forget about it, you’ll probably want to run SvnBot within a nohup operator. The nohup command will allow the Java process to continue running even after you’re shell has disconnected (i.e. ignore the “hang up” signal). Here’s an example as for quick reference:

nohup java -jar svnbot-1.1-jar-with-dependencies.jar -c path/to/config
      < /dev/null >> /dev/null 2>> /dev/null &


The configuration file format is a mix of XML and standard Java properties similar to Apache’s httpd configuration format. There are three types of configuration sections: <irc>, <log4j>, and multiple <repository> tags.

<irc> This section configures the IRC server and channel where to announce changes.

<log4j> This section configures how logging messages from SvnBot will be handled. This uses standard log4j syntax.

<repository> This section configures an SVN repository to monitor: specify the url, authentication, polling frequency, etc. The SVN bot is capable of monitoring multiple repositories, just add multiple definitions for each repository.

Below is the example configuration file. Note only the IRC’s server, channel, and repository’s url are required parameters. All other parameters are optional, either for special circumstances or have reasonable defaults.

# SvnBot Configuration
# java -jar svnbot-1.1-jar-with-dependencies.jar -c path/to/this/config
# Note you must use XML escaping such as: &amp; &lt; &gt; &quot &apos

    # The hostname, port, and channel of the IRC server
    server =
    channel = #svnbot
    #port = 6667

    # The nickname to use when communicating on IRC
    #nick = SvnBot

    # Authentication credentials for the IRC Server
    #username = your-irc-username
    #password = your-irc-password

    # The notice message is sent to everyone in the channel when the bot
    # first starts, letting others know that the bot has joined the 
    # channel.
    #notice = I am an SVN Bot. I report commits to the ??? repository.

# Optional logging configuration.
    # This section uses Log4j configuration syntax. The example below
    # will log messages to /var/log/svnbot.log. However, if no log4j
    # section exists then all messages INFO and higher will be sent to
    # stdout.
    # See for more
    # information

    # Log everything INFO and greater to a File
    #log4j.rootLogger = INFO, FILE

    # Define the FILE's location
    #log4j.appender.FILE = org.apache.log4j.FileAppender
    #log4j.appender.FILE.File = /var/log/svnbot.log

    # Define the FILE's layout
    #log4j.appender.FILE.layout.ConversionPattern = \
              %d{ISO8601} [%t] %-5p %c %x - %m%n

# Repeatable repository configuration.
<repository type="svn">
    # The URL of your SVN repository
    url = https://yourepository/

    # Authentication credentials for the SVN Server
    #username = your-svn-username
    #password = your-svn-password

    # Targeted paths restrict the SvnBot's focus to only monitor changes
    # within the specified paths. There can be multiple paths separated
    # by a comma and each path must be anchored to the root of the
    # repository. Only commits to the repository that affects a file under
    # one of these paths will be reported in IRC.
    #targetPaths = project1/ project2/subproject, ...

    # The amount of time between polling the repository. Periodically
    # SvnBot will check the repository to see if there have been any
    # new commits. The default interval is 30 seconds. However, if
    # your repository is under heavy load you should use a higher
    # interval such as 60 or 150 seconds.
    #pollinterval = 30

    # Nicknames are used to translate the repository's usernames into
    # something more friendly. The username on the left side will be
    # replaced with the nickname from the right side when the commit
    # is announced in IRC.
        william = Bill
        charles = Chuck = Short &amp; Sweet

# Repeat the repository section for each repository.

How to compile


This project uses Apache Maven as its build and distribution management system. To compile the project use the following maven command:

mvn package

Two binary files will be compiled into the “/target” directory. You will find “svnbot-<version>-jar-with-dependencies.jar” which is a runnable jar file. The other jar file included is “svnbot-<version>.jar” which just includes the svnbot class files without other dependencies for SVN or logging. This jar file is suitable for inclusion in other projects.

This project uses the PircBot library to handle communication with the IRC Server. Another important dependency is the pure Java implementation of the SVN protocol with the SvnKit library.


[1] “SvnBot – Miscbits“, A Python SVN Notification IRC bot, using commit-hooks.

[2] “Writing an irc bot for svn commit notification“, A simple Perl script to send notification of SVN changes to IRC, also using commit-hooks.

[3] “IRCcat“, A Java-based IRC bot enabling shell scripts to send messages to IRC through a local port. This can be combined with a commit-hook to announce changes in IRC.

Tags: , , ,

One Response to “SvnBot 1.1 Released”

  1. Scott says:

    To follow up on my own post with a comment…

    I do intend to add support for git repositories in the future. I’m not exactly sure how it will work because when git merge occures it may insert previous commits into the history without effecting the last one. I’ll figure something out with regards to that. From the configuration file you can see the hint at other repository types because it does include the type="svn" attribute.

    It will probably be several months before I even start working on git support.

Leave a Reply