SVN Tips

From Opentaps Wiki
Jump to navigationJump to search

Setting up Commit Emails

Before we begin, ensure that mail can be sent from the server on which the subversion repository lives. If you're on a UNIX OS, this can be done by running the mail program from the command line,

 prompt:> mail -s "test subject"
 Type in body of email and press CTRL-D to send.

Next, go to the hooks/ directory of our subversion repository. It should contain several files ending in .tmpl. These are shell script templates that allow you to hook actions to subversion events. In particular, we are looking for post-commit.tmpl which we will use to send email whenever a commit is made.

  • Ensure that exists in hooks/ directory. If you cannot find it, get it from here.
  • Create a copy of post-commit.tmpl named post-commit
  • Edit post-commit and add the following before the call to
  • Comment out if present, it's not necessary. This script only needs to do
  • Specify the email or space separated list of emails to send these commit notifications to as the last arguments to
  • Make sure that and post-commit are executable by anyone
 chmod a+x post-commit

This should basically be it. Commit something to test things out. If there is a problem, it will usually show up in the mail server logs. The next sections cover possible issues.

Permission Denied

If you're running svnserve to allow checkout using svn:// URL notation, then you have to make sure that the user that runs svnserve can also read and execute the scripts in hooks/. Make sure this user owns that directory and all files in it.

You might also want to make sure this user can send emails to the mailserver. Log in as the user and use the mail command to test this.