After setting up an instance of SVN using the instructions I found here. I wanted to setup email notification for every commit on a SVN server. I was able to setup SVN::Notify using the tutorial on this page. When attempting to run
perl -MCPAN -e 'install SVN::Notify', the install command complained that MakeMaker version is not new enough. So, I went to this CPAN page and download the module and install it before resume installing SVN::Notify. The install command complained again about a missing directory. I repeated the command and the installation completed successfully.
The instruction statement on “replace the existing call to commit-email.pl” wasn’t very clear to me. It didn’t say which file I should edit. I eventually figured out that I should make a copy of
[SVN_REPOSITORY]/hooks/post-commit.tmpl file and name the new file
[SVN_REPOSITORY]/hooks/post-commit. In the file, I commented out the following line:
mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf
Next, I added the following line:
/usr/bin/svnnotify --repos-path "$1" --revision "$2" --to firstname.lastname@example.org --user-domain mydomain
Please note that I replaced
mydomain with correct values for my environment. I also ran the following command to make it executable.
chmos +x post-commit
After completed all these, I was able to receive the email notification every time an user commit to the repository.