Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the SVN-Notify CPAN distribution.

Report information
The Basics
Id: 50390
Status: rejected
Priority: 0/
Queue: SVN-Notify

People
Owner: Nobody in particular
Requestors: bdfoy [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.79
Fixed in: (no value)



Subject: Suppress warnings when the log message is empty or short
prepare_subject issues some warnings when the log message is missing or very short. We should hit those users with sticks, but I think this at least gets rid of the warnings. I'm not sure what you'd want to the subject otherwise. diff --git a/lib/SVN/Notify.pm b/lib/SVN/Notify.pm index 3f3672b..5387dd2 100644 --- a/lib/SVN/Notify.pm +++ b/lib/SVN/Notify.pm @@ -1308,7 +1308,7 @@ sub prepare_subject { } # Add the first sentence/line from the log message. - unless ($self->{no_first_line}) { + if (!$self->{no_first_line} and defined $self->{message}[0] and length $self->{me # Truncate to first period after a minimum of 10 characters. my $i = index substr($self->{message}[0], 10), '. '; $self->{subject} .= $i > 0
Subject: Re: [rt.cpan.org #50390] Suppress warnings when the log message is empty or short
Date: Sun, 11 Oct 2009 08:57:26 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Oct 11, 2009, at 3:49 AM, brian d foy via RT wrote: Show quoted text
> --- a/lib/SVN/Notify.pm > +++ b/lib/SVN/Notify.pm > @@ -1308,7 +1308,7 @@ sub prepare_subject { > } > > # Add the first sentence/line from the log message. > - unless ($self->{no_first_line}) { > + if (!$self->{no_first_line} and defined $self->{message}[0] and > length $self->{me > # Truncate to first period after a minimum of 10 characters. > my $i = index substr($self->{message}[0], 10), '. '; > $self->{subject} .= $i > 0
Looks like that got truncated; can you sent it as an attachment, perhaps? Best, David
It was my fault it got cut off. I think the patch is probably crap though. It's a band-aid for something I don't have time to investigate further. The problem seems to crop up when there is no commit message, but I think the {no_first_line} should catch that. Maybe users are sneaking whitespace log messages through to make it look like there is a message when there really isn't. So, maybe there is a short message less than 10 chars. The substr then goes out of bounds causing a warning. Sorry I can't be more help at the moment.
diff --git a/lib/SVN/Notify.pm b/lib/SVN/Notify.pm index 3f3672b..5387dd2 100644 --- a/lib/SVN/Notify.pm +++ b/lib/SVN/Notify.pm @@ -1308,7 +1308,7 @@ sub prepare_subject { } # Add the first sentence/line from the log message. - unless ($self->{no_first_line}) { + if (!$self->{no_first_line} and defined $self->{message}[0] and length $self->{message}[0] >= 10 ) { # Truncate to first period after a minimum of 10 characters. my $i = index substr($self->{message}[0], 10), '. '; $self->{subject} .= $i > 0