[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: email notifications

From: Marc Haisenko <haisenko_at_webport.de>
Date: 2004-06-22 14:51:09 CEST

On Tuesday 22 June 2004 11:11, Roger Keays wrote:
> Hi all,
>
> Does subversion have any built in features to do email notifications on
> checkins? Or maybe there is a good post-commit script that has been widely
> used and tested?
>
> Cheers,
>
> Roger (recent cvs convert)

Simply create a post-commit hook like this (that is, an executable script
called /path/to/svnrepository/hooks/post-commit):

#!/bin/bash
REPOS="$1"
REV="$2"
TEMPFILE=`mktemp /tmp/postcommit.XXXXXX`

AUTHOR=`svnlook author "$1" -r $2`
if [ -z "$AUTHOR" ] ; then
    AUTHOR="<Unknown>" ;
fi

svnlook log "$1" >$TEMPFILE
echo "" >>$TEMPFILE
svnlook changed "$1" >>$TEMPFILE

mail -s "[SubVersion] $AUTHOR committed revision $2" some-list@somehost.net \
   <$TEMPFILE

rm -f $TEMPFILE

This will mail an email with the subject "[SubVersion] foo committed revision
123" to some mailing list. The body contains the log message from the user
and what files have been changed. Simple, but useful.

-- 
Marc Haisenko
Systemspezialist
Webport IT-Services GmbH
mailto: haisenko@webport.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jun 22 14:57:31 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.