SVN notifications

I’ve been investigating how to send notification emails when changes are committed in a Subversion repository. Two interesting options I found are svnnotify and svnmailer.

svnnotify looks reasonable (read the man page). It generates HTML email with colored diffs (not as nice as Trac’s diff engine) and is configurable via CLI options to send email to different addresses based on regular expression matches against the directories affected by the commit.

Example: put this in “/repo/hooks/post-commit”



/opt/perl/bin/svnnotify \
    -p $REPOS \
    -r $REV \
    -C -d -H HTML::ColorDiff \
    --from \
    --reply-to \
    -x"^foo/" \
    -x ","="^big_framework/" \

I also looked at svnmailer but it uses unified diff format by default which doesn’t look so nice. You can specify your own diff script via the CLI, but I don’t know of any good ones off hand.

Can anyone suggest a good diff script?
Anybody know offhand if Trac uses a standalone diff engine that I could hook up to svnmailer?

Leave a Reply

Your email address will not be published. Required fields are marked *