You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Gustavo Delfino <gd...@umich.edu> on 2007/08/15 22:22:01 UTC
[PATCH] fix for mail header bug in commit-email.pl
[[[
* trunk/tools/hook-scripts/commit-email.pl.in: Bug Fix
My notification emails are being sent with an incorrect "From" header.
Considering that in line 208 we have:
elsif ($arg eq '--stdout')
{
$current_project->{stdout} = 1;
}
And in line 715 we have:
sub new_project
{
return {email_addresses => [],
from_address => '',
hostname => '',
log_file => '',
match_regex => '.',
reply_to => '',
subject_prefix => '',
show_diff => 1,
stdout => 0};
}
And that "defined $stdout" is true when $stdout is equal to number 0
Then I propose this change in commit-email.pl:
John Peacock, who I understand wrote the original script encouraged
me to submit this patch.
Patch by: Gustavo Delfino <gd...@umich.edu>
Review by: John Peacock <jp...@rowman.com>
]]]
@@ -547,7 +547,7 @@
my @head;
my $formatted_date;
- if (defined $stdout)
+ if (defined $stdout && $stdout == 1)
{
$formatted_date = strftime('%a %b %e %X %Y', localtime());
push(@head, "From $mail_from $formatted_date\n");
Re: [PATCH] fix for mail header bug in commit-email.pl
Posted by David Glasser <gl...@davidglasser.net>.
On 8/15/07, Gustavo Delfino <gd...@umich.edu> wrote:
> [[[
> * trunk/tools/hook-scripts/commit-email.pl.in: Bug Fix
>
> My notification emails are being sent with an incorrect "From" header.
>
> Considering that in line 208 we have:
>
> elsif ($arg eq '--stdout')
> {
> $current_project->{stdout} = 1;
> }
>
> And in line 715 we have:
>
> sub new_project
> {
> return {email_addresses => [],
> from_address => '',
> hostname => '',
> log_file => '',
> match_regex => '.',
> reply_to => '',
> subject_prefix => '',
> show_diff => 1,
> stdout => 0};
> }
>
> And that "defined $stdout" is true when $stdout is equal to number 0
>
> Then I propose this change in commit-email.pl:
>
> John Peacock, who I understand wrote the original script encouraged
> me to submit this patch.
>
> Patch by: Gustavo Delfino <gd...@umich.edu>
> Review by: John Peacock <jp...@rowman.com>
> ]]]
> @@ -547,7 +547,7 @@
>
> my @head;
> my $formatted_date;
> - if (defined $stdout)
> + if (defined $stdout && $stdout == 1)
> {
> $formatted_date = strftime('%a %b %e %X %Y', localtime());
> push(@head, "From $mail_from $formatted_date\n");
Hi Gustavo. You probably want to send the whole output of "svn diff",
which includes header lines saying which files changed.
I'm not too familiar with this particular script but I would just do
"if ($stdout)" (which is done later in the function anyway).
--dave
--
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org