You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Mauro Gatti <ma...@yahoo.com> on 2010/06/01 10:31:18 UTC

post-commit script sends a void message

Hi all,
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...@directline.italy>'
done<$MAIL_LIST


Does anybody has any idea about what is happening?

Thank You

Regards

Mauro



      

Re: post-commit script sends a void message

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 4, 2010, at 01:39, Mauro Gatti wrote:

>>> Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
>>> Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
>> 
>> I added two flags to svnnotify:
>> --svnlook      
>> --sendmail      

Right, it looks like otherwise it doesn't know where to find your svnlook program.


>> and now i got only these two errors:
>> 
>> 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.
> 
> Maybe I found the problem.
> It seems there is a problem in line 1030 in Noitify.pm
> 
> my $i = index substr($self->{message}[0], 10), '. '; 
> 
> What happens if the comment I insert when I commit something is less then 10 characters and doesn't contain a period?


Right, this looks like a known issue:

https://rt.cpan.org/Public/Bug/Display.html?id=50390



Re: post-commit script sends a void message

Posted by Mauro Gatti <ma...@yahoo.com>.
Maybe I found the problem.
It seems there is a problem in line 1030 in Noitify.pm

my $i = index substr($self->{message}[0], 10), '. '; 

What happens if the comment I insert when I commit something is less then 10 characters and doesn't contain a period?

Thanks

Regards

Mauro







________________________________
From: Mauro Gatti <ma...@yahoo.com>
To: Ryan Schmidt <su...@ryandesign.com>
Cc: users@subversion.apache.org
Sent: Thu, June 3, 2010 5:47:41 PM
Subject: Re: post-commit script sends a void message


Hi Ryan,
I added two flags to svnnotify:
--svnlook      
--sendmail      
and now i got only these two errors:

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.


Anyway now I can see a well formatted message.

Do you know why this still happens?

Thank You

Regards

Mauro




________________________________
From: Mauro Gatti <ma...@yahoo.com>
To: Ryan Schmidt <su...@ryandesign.com>
Cc: users@subversion.apache.org
Sent: Thu, June 3, 2010 4:57:31 PM
Subject: Re: post-commit script sends a void message


Hi Ryan,
I modified the pot-commit script as you recommended.
Last two lines contain the echo of $1 and $2.
Of course there is something wrong but I can't figure out what it is.

I got these error in the log file:


 more /tmp/post-commit.log
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Child process exited: 512
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Child process exited: 512
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Use of uninitialized value in substitution (s///) at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1233.
Use of uninitialized value in substitution (s///) at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1234.
Child process exited: 512
Use of uninitialized value in substr at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1303.
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.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1304.
Use of uninitialized value in substitution (s///) at (eval 8) line 1.
Use of uninitialized value in print at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify/HTML.pm line 323.
Use of uninitialized value in substitution (s///) at (eval 8) line 1.
Use of uninitialized value in print at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify/HTML.pm line 326.
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Child process exited: 512
Repos= /opt/data/svn_repositories/unix
Rev= 12



Do you have any idea?

Thank You again

Regards

Mauro






________________________________
From: Ryan Schmidt <su...@ryandesign.com>
To: Mauro Gatti <ma...@yahoo.com>
Cc: users@subversion.apache.org
Sent: Tue, June 1, 2010 11:23:39 PM
Subject: Re: post-commit script sends a void message


On Jun 1, 2010, at 06:52, Mauro Gatti wrote:

> Ryan Schmidt wrote on Tue, June 1, 2010 at 12:40:
> 
>> On Jun 1, 2010, at 05:31, Mauro Gatti wrote:
>> 
>> > #!/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@>'
>> > 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@>'
>> done<$MAIL_LIST
>> 
> 
> Actually I added at the bottom of the script:
> 
> echo "Repos= $REPOS" >> /tmp/post-commit.log
> echo "Rev= $REV" >> /tmp/post-commit.log
> 
> and I checket the file so created.
> Both $REPOS and $REV seem well valorized. In particular $REPOS created as $PATH_TO_REPOS$REPOS seems well formed with a full path aspect.


Hmm. I wasn't aware it was possible for $1 to not contain the full absolute path to the repository. I wonder why in your case it isn't.

But ignoring that for a moment, I think we can assume *some* error is occurring, perhaps in the svnnotify script, and that maybe it is printing information to stderr which would be helpful in resolving it. You should try logging stderr to a file so you can see it, e.g.:

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@>'
done<$MAIL_LIST 2>>/tmp/post-commit.log


      

Re: post-commit script sends a void message

Posted by Mauro Gatti <ma...@yahoo.com>.
Hi Ryan,
I added two flags to svnnotify:
--svnlook      
--sendmail      
and now i got only these two errors:

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.


Anyway now I can see a well formatted message.

Do you know why this still happens?

Thank You

Regards

Mauro




________________________________
From: Mauro Gatti <ma...@yahoo.com>
To: Ryan Schmidt <su...@ryandesign.com>
Cc: users@subversion.apache.org
Sent: Thu, June 3, 2010 4:57:31 PM
Subject: Re: post-commit script sends a void message


Hi Ryan,
I modified the pot-commit script as you recommended.
Last two lines contain the echo of $1 and $2.
Of course there is something wrong but I can't figure out what it is.

I got these error in the log file:


 more /tmp/post-commit.log
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Child process exited: 512
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Child process exited: 512
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Use of uninitialized value in substitution (s///) at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1233.
Use of uninitialized value in substitution (s///) at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1234.
Child process exited: 512
Use of uninitialized value in substr at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1303.
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.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1304.
Use of uninitialized value in substitution (s///) at (eval 8) line 1.
Use of uninitialized value in print at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify/HTML.pm line 323.
Use of uninitialized value in substitution (s///) at (eval 8) line 1.
Use of uninitialized value in print at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify/HTML.pm line 326.
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Child process exited: 512
Repos= /opt/data/svn_repositories/unix
Rev= 12



Do you have any idea?

Thank You again

Regards

Mauro






________________________________
From: Ryan Schmidt <su...@ryandesign.com>
To: Mauro Gatti <ma...@yahoo.com>
Cc: users@subversion.apache.org
Sent: Tue, June 1, 2010 11:23:39 PM
Subject: Re: post-commit script sends a void message


On Jun 1, 2010, at 06:52, Mauro Gatti wrote:

> Ryan Schmidt wrote on Tue, June 1, 2010 at 12:40:
> 
>> On Jun 1, 2010, at 05:31, Mauro Gatti wrote:
>> 
>> > #!/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@>'
>> > 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@>'
>> done<$MAIL_LIST
>> 
> 
> Actually I added at the bottom of the script:
> 
> echo "Repos= $REPOS" >> /tmp/post-commit.log
> echo "Rev= $REV" >> /tmp/post-commit.log
> 
> and I checket the file so created.
> Both $REPOS and $REV seem well valorized. In particular $REPOS created as $PATH_TO_REPOS$REPOS seems well formed with a full path aspect.


Hmm. I wasn't aware it was possible for $1 to not contain the full absolute path to the repository. I wonder why in your case it isn't.

But ignoring that for a moment, I think we can assume *some* error is occurring, perhaps in the svnnotify script, and that maybe it is printing information to stderr which would be helpful in resolving it. You should try logging stderr to a file so you can see it, e.g.:

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@>'
done<$MAIL_LIST 2>>/tmp/post-commit.log


      

Re: post-commit script sends a void message

Posted by Mauro Gatti <ma...@yahoo.com>.
Hi Ryan,
I modified the pot-commit script as you recommended.
Last two lines contain the echo of $1 and $2.
Of course there is something wrong but I can't figure out what it is.

I got these error in the log file:


 more /tmp/post-commit.log
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Child process exited: 512
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Child process exited: 512
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Use of uninitialized value in substitution (s///) at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1233.
Use of uninitialized value in substitution (s///) at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1234.
Child process exited: 512
Use of uninitialized value in substr at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1303.
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.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 1304.
Use of uninitialized value in substitution (s///) at (eval 8) line 1.
Use of uninitialized value in print at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify/HTML.pm line 323.
Use of uninitialized value in substitution (s///) at (eval 8) line 1.
Use of uninitialized value in print at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify/HTML.pm line 326.
Use of uninitialized value in exec at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Can't exec "": No such file or directory at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm line 2303.
Cannot exec : No such file or directory
Child process exited: 512
Repos= /opt/data/svn_repositories/unix
Rev= 12



Do you have any idea?

Thank You again

Regards

Mauro






________________________________
From: Ryan Schmidt <su...@ryandesign.com>
To: Mauro Gatti <ma...@yahoo.com>
Cc: users@subversion.apache.org
Sent: Tue, June 1, 2010 11:23:39 PM
Subject: Re: post-commit script sends a void message


On Jun 1, 2010, at 06:52, Mauro Gatti wrote:

> Ryan Schmidt wrote on Tue, June 1, 2010 at 12:40:
> 
>> On Jun 1, 2010, at 05:31, Mauro Gatti wrote:
>> 
>> > #!/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@>'
>> > 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@>'
>> done<$MAIL_LIST
>> 
> 
> Actually I added at the bottom of the script:
> 
> echo "Repos= $REPOS" >> /tmp/post-commit.log
> echo "Rev= $REV" >> /tmp/post-commit.log
> 
> and I checket the file so created.
> Both $REPOS and $REV seem well valorized. In particular $REPOS created as $PATH_TO_REPOS$REPOS seems well formed with a full path aspect.


Hmm. I wasn't aware it was possible for $1 to not contain the full absolute path to the repository. I wonder why in your case it isn't.

But ignoring that for a moment, I think we can assume *some* error is occurring, perhaps in the svnnotify script, and that maybe it is printing information to stderr which would be helpful in resolving it. You should try logging stderr to a file so you can see it, e.g.:

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@>'
done<$MAIL_LIST 2>>/tmp/post-commit.log


      

Re: post-commit script sends a void message

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Ryan Schmidt wrote on Tue, 1 Jun 2010 at 16:23 -0500:
> On Jun 1, 2010, at 06:52, Mauro Gatti wrote:
> > [ ... about post-commit hooks ... ]
> 
> Hmm. I wasn't aware it was possible for $1 to not contain the full
> absolute path to the repository. I wonder why in your case it isn't.

The code doesn't make svn_repos_t.path absolute anywhere.  I guess
it'll be relative path if the user gives the repository path as
a relative path (possibly in svnserve/httpd's configuration).

Re: post-commit script sends a void message

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 1, 2010, at 06:52, Mauro Gatti wrote:

> Ryan Schmidt wrote on Tue, June 1, 2010 at 12:40:
> 
>> On Jun 1, 2010, at 05:31, Mauro Gatti wrote:
>> 
>> > #!/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@>'
>> > 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@>'
>> done<$MAIL_LIST
>> 
> 
> Actually I added at the bottom of the script:
> 
> echo "Repos= $REPOS" >> /tmp/post-commit.log
> echo "Rev= $REV" >> /tmp/post-commit.log
> 
> and I checket the file so created.
> Both $REPOS and $REV seem well valorized. In particular $REPOS created as $PATH_TO_REPOS$REPOS seems well formed with a full path aspect.


Hmm. I wasn't aware it was possible for $1 to not contain the full absolute path to the repository. I wonder why in your case it isn't.

But ignoring that for a moment, I think we can assume *some* error is occurring, perhaps in the svnnotify script, and that maybe it is printing information to stderr which would be helpful in resolving it. You should try logging stderr to a file so you can see it, e.g.:

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@>'
done<$MAIL_LIST 2>>/tmp/post-commit.log



Re: post-commit script sends a void message

Posted by Mauro Gatti <ma...@yahoo.com>.
Actually I added at the bottom of the script:

echo "Repos= $REPOS" >> /tmp/post-commit.log
echo "Rev= $REV" >> /tmp/post-commit.log


and I checket the file so created.
Both $REPOS and $REV seem well valorized. In particular $REPOS created as $PATH_TO_REPOS$REPOS seems well formed with a full path aspect.

Regards
Mauro


________________________________
From: Ryan Schmidt <su...@ryandesign.com>
To: Mauro Gatti <ma...@yahoo.com>
Cc: users@subversion.apache.org
Sent: Tue, June 1, 2010 12:40:00 PM
Subject: Re: post-commit script sends a void message


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@>'
> 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@>'
done<$MAIL_LIST


      

Re: post-commit script sends a void message

Posted by Ryan Schmidt <su...@ryandesign.com>.
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...@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...@directline.italy>'
done<$MAIL_LIST