Growl Notification for Subversion

I’ve written a little shell script that can be used to poll a Subversion repository and notify you via Growl when new revisions are added.

To start using it, download svn-growlnotify from github, copy svn-growlnotify.sh somewhere so you don’t lose it, make sure it is executable (chmod +x svn-growlnotify.sh), and set up a crontab entry to run it with your repository URL:

* * * * * /path/to/svn-growlnotify.sh -s http://your.repository.url/ 1>/dev/null 2>&1

Here’s the source code:

  • Sean Whitney

    Updated your script to support monitoring multiple svn repositories

    Here’s a patch file

    — svn-growlnotify.sh 2010-05-04 15:15:22.000000000 -0700
    +++ /Users/sean/bin/svn-growlnotify.sh 2012-01-26 16:43:35.000000000 -0800
    @@ -10,7 +10,6 @@
    # Default settings
    SVN_ROOT=””
    LOG_URL=””
    -REV_FILE=”$HOME/.svn-growlnotify.version”
    MAX_REVS=”5″
    GROWLNOTIFY=”/usr/local/bin/growlnotify”

    @@ -24,6 +23,9 @@
    g) GROWLNOTIFY=$OPTARG;;
    esac
    done
    +REV_FILE=”$HOME/.svn-growlnotify/$(basename $SVN_ROOT)”
    +
    +test -d $HOME/.svn-growlnotify || mkdir -p $HOME/.svn-growlnotify

    if [ “$SVN_ROOT” = “” ]; then
    echo “Usage: $0 -s [-l LOG_URL] [-r REV_FILE] [-m MAX_REVS] [-g GROWLNOTIFY]”

    I also converted your cronjobs to a launchd job. Mine is set to 120 seconds instead of 60.

    Label
    repository name
    ProgramArguments

    /path/to/svn-growlnotify.sh
    -s
    http://your.repository.ur/l
    1>/dev/null
    2>&1

    StartInterval
    120

    I named the file svn.repository.plist, and put it in ~/Library/LaunchAgents
    then I ran launchctl load svn.repository.plist

    Sean

  • Mike

    Thanks Sean, that looks great. I’m no longer monitoring any SVN repositories, but I’m sure your changes will be helpful for anyone wandering across this post in the future.