Setting up email notification for Subversion commits on Linux CentOS

To setup email notifications when an svn commit is done to svn repository on a linux server, first you need to install perl module SVN::Notify

Once installed you’ll have a utility called svnnotify.

Under your repository’s hooks folder create a file post-commit

#!/bin/sh
REPOS="$1"
REV="$2"
/usr/local/bin/svnnotify -r $REV -C -d -H HTML::ColorDiff \
-p $REPOS -t to-mail@domain.tld --from from-mail@domain.tld \
--reply-to reply-to@domain.tld

Make this script executable by web server and update the email addresses in the above script appropriately. To test the script execute this command

./post-commit path/to/your/repos #

where # is an actual revision number. And you’ll receive an email notification with details of that particular commit.

Help taken from http://help.joyent.com/index.php?pg=kb.page&id=53

0 Comments

  1. There are no comments yet.

Add Your Comment

Make sure you share your opinion with us. Fields marked * are required. Any other information is optional and for your own pleasure. Your email address will be hidden and never published or used in any way.


Optional Details

If you like you can tell us your website URL and Twitter Username. We'll link your name to your web address and we'll add a twitter link to your comment. This is completely optional.