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

Re: post-commit script sends a void message

From: Ryan Schmidt <subversion-2010b_at_ryandesign.com>
Date: Tue, 1 Jun 2010 05:40:00 -0500

On Jun 1, 2010, at 05:31, Mauro Gatti wrote:

> I'm trying to implement a post commit script based on svnnotify which should send an email with some information after a commit.
> Unluckily I receive a mail with a void body.
> If I run this script manually the email message is ok but I got anyway this error:
>
> substr outside of string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1303.
> Use of uninitialized value in index at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1303.
>
> This is my post-commit script:
>
>
> #!/bin/sh
> MAIL_LIST="/opt/data/svn_repositories/email.list"
> PATH_TO_REPOS="/opt/data/svn_repositories/"
> REPOS="$1"
> REV="$2"
> while read line
> do
> /usr/bin/svnnotify -r "$REV" -C -d -H Alternative \
> --alt HTML::ColorDiff -p "$PATH_TO_REPOS$REPOS" -t "$line" \
> --from 'SVN @ Collaboration Server <no-reply_at_directline.italy>'
> done<$MAIL_LIST
>
>
> Does anybody has any idea about what is happening?

Inspect the value of the $REPOS variable. You should find it already contains the full path to the repository. Therefore perhaps you want:

#!/bin/sh
MAIL_LIST="/opt/data/svn_repositories/email.list"
REPOS="$1"
REV="$2"
while read line
do
/usr/bin/svnnotify -r "$REV" -C -d -H Alternative \
 --alt HTML::ColorDiff -p "$REPOS" -t "$line" \
 --from 'SVN @ Collaboration Server <no-reply_at_directline.italy>'
done<$MAIL_LIST
Received on 2010-06-01 12:40:45 CEST

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.