* git send-email woes
@ 2006-09-24 22:43 Sam Ravnborg
2006-09-25 18:32 ` Sam Ravnborg
0 siblings, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2006-09-24 22:43 UTC (permalink / raw)
To: git
I stumbled on two issues with git-send-email today.
First of I forgot to tell where to find the patch files to send.
But git-send-email only complained _after_ I had given all
the information manually.
It would have been niver to check that all mandatory arguments
was present before being interactive.
The second issue are best explained quoting a mail from Matti Arnio:
> > The GIT is at times producing emails that are not
> > utterly strictly speaking kosher RFC-(2)822 format.
> >
> > It might be a surprise to you that unquoted dots in
> > people's names cause syntax scanner indigestion,
> > because said character has very special meaning in
> > RFC-822 syntax. All would be fine if
> > Example J.P. Example <example@example.net>
> > had couple quotes:
> > "Example J.P. Example" <example@example.net>
What I could see was that git-send-email takes mail address
verbatim from "Signed-off-by:" lines and use it.
Would it be possible to always quote it except when quoted
or to do a more intelligent RFC2822 check?
That would keep suprises lower.
I'm not good a perlish so I have not attempted fixing it myself...
Sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git send-email woes
2006-09-24 22:43 git send-email woes Sam Ravnborg
@ 2006-09-25 18:32 ` Sam Ravnborg
2006-09-25 19:58 ` Junio C Hamano
0 siblings, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2006-09-25 18:32 UTC (permalink / raw)
To: git
On Mon, Sep 25, 2006 at 12:43:16AM +0200, Sam Ravnborg wrote:
> I stumbled on two issues with git-send-email today.
> First of I forgot to tell where to find the patch files to send.
> But git-send-email only complained _after_ I had given all
> the information manually.
> It would have been niver to check that all mandatory arguments
> was present before being interactive.
>
> The second issue are best explained quoting a mail from Matti Arnio:
> > > The GIT is at times producing emails that are not
> > > utterly strictly speaking kosher RFC-(2)822 format.
> > >
> > > It might be a surprise to you that unquoted dots in
> > > people's names cause syntax scanner indigestion,
> > > because said character has very special meaning in
> > > RFC-822 syntax. All would be fine if
> > > Example J.P. Example <example@example.net>
> > > had couple quotes:
> > > "Example J.P. Example" <example@example.net>
>
> What I could see was that git-send-email takes mail address
> verbatim from "Signed-off-by:" lines and use it.
The patches in quistion did not have a "Signed-off-by: tag so
that mail address has been from the author instead.
And this mail address was still invalid as per RFC2822.
> Would it be possible to always quote it except when quoted
> or to do a more intelligent RFC2822 check?
>
> That would keep suprises lower.
>
> I'm not good a perlish so I have not attempted fixing it myself...
Sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git send-email woes
2006-09-25 18:32 ` Sam Ravnborg
@ 2006-09-25 19:58 ` Junio C Hamano
2006-09-25 21:17 ` David Miller
2006-09-25 21:51 ` Sam Ravnborg
0 siblings, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2006-09-25 19:58 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: git
Sam Ravnborg <sam@ravnborg.org> writes:
> The patches in quistion did not have a "Signed-off-by: tag so
> that mail address has been from the author instead.
> And this mail address was still invalid as per RFC2822.
I do not think it takes Signed-off-by: as author in any case
(and I do not think it should -- if it did so it is a bug).
Maybe something like this?
diff --git a/git-send-email.perl b/git-send-email.perl
index 746c525..b4a34f4 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -431,6 +431,11 @@ sub send_message
$gitversion =~ s/^.* //;
}
+ my ($author_name) = ($from =~ /^(.*?)\s+</);
+ if ($author_name =~ /\./ && $author_name !~ /^".*"$/) {
+ my ($name, $addr) = ($from =~ /^(.*?)(\s+<.*)/);
+ $from = "\"$name\"$addr";
+ }
my $header = "From: $from
To: $to
Cc: $cc
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: git send-email woes
2006-09-25 19:58 ` Junio C Hamano
@ 2006-09-25 21:17 ` David Miller
2006-09-25 21:51 ` Sam Ravnborg
1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2006-09-25 21:17 UTC (permalink / raw)
To: junkio; +Cc: sam, git
From: Junio C Hamano <junkio@cox.net>
Date: Mon, 25 Sep 2006 12:58:21 -0700
> Sam Ravnborg <sam@ravnborg.org> writes:
>
> > The patches in quistion did not have a "Signed-off-by: tag so
> > that mail address has been from the author instead.
> > And this mail address was still invalid as per RFC2822.
>
> I do not think it takes Signed-off-by: as author in any case
> (and I do not think it should -- if it did so it is a bug).
>
> Maybe something like this?
That looks like it would do the trick.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git send-email woes
2006-09-25 19:58 ` Junio C Hamano
2006-09-25 21:17 ` David Miller
@ 2006-09-25 21:51 ` Sam Ravnborg
2006-09-26 4:11 ` Junio C Hamano
1 sibling, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2006-09-25 21:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Mon, Sep 25, 2006 at 12:58:21PM -0700, Junio C Hamano wrote:
> Sam Ravnborg <sam@ravnborg.org> writes:
>
> > The patches in quistion did not have a "Signed-off-by: tag so
> > that mail address has been from the author instead.
> > And this mail address was still invalid as per RFC2822.
>
> I do not think it takes Signed-off-by: as author in any case
> (and I do not think it should -- if it did so it is a bug).
>
> Maybe something like this?
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 746c525..b4a34f4 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -431,6 +431,11 @@ sub send_message
> $gitversion =~ s/^.* //;
> }
>
> + my ($author_name) = ($from =~ /^(.*?)\s+</);
> + if ($author_name =~ /\./ && $author_name !~ /^".*"$/) {
> + my ($name, $addr) = ($from =~ /^(.*?)(\s+<.*)/);
> + $from = "\"$name\"$addr";
> + }
> my $header = "From: $from
> To: $to
> Cc: $cc
>
I would assume we had to do the same for all mail addresses?
In this case also for $to and $cc and $reply_to.
Sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git send-email woes
2006-09-25 21:51 ` Sam Ravnborg
@ 2006-09-26 4:11 ` Junio C Hamano
0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2006-09-26 4:11 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: git
Sam Ravnborg <sam@ravnborg.org> writes:
>> @@ -431,6 +431,11 @@ sub send_message
>> $gitversion =~ s/^.* //;
>> }
>>
>> + my ($author_name) = ($from =~ /^(.*?)\s+</);
>> + if ($author_name =~ /\./ && $author_name !~ /^".*"$/) {
>> + my ($name, $addr) = ($from =~ /^(.*?)(\s+<.*)/);
>> + $from = "\"$name\"$addr";
>> + }
>> my $header = "From: $from
>> To: $to
>> Cc: $cc
>>
> I would assume we had to do the same for all mail addresses?
> In this case also for $to and $cc and $reply_to.
I do not think so, although I admit I only had a cursory look at
the code. In this part of the code, $to and $cc are coming from
return value of unique_email_list sub, which cleanses each
address with extract_valid_address sub. This sub does:
A U Thor <foo@bar.baz> => foo@bar.baz
In other words, I think it is only "$from" that needs it.
I think $to and $cc should not strip out the human-readable name,
but in this case it saved us extra trouble. Sigh...
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-09-26 4:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-24 22:43 git send-email woes Sam Ravnborg
2006-09-25 18:32 ` Sam Ravnborg
2006-09-25 19:58 ` Junio C Hamano
2006-09-25 21:17 ` David Miller
2006-09-25 21:51 ` Sam Ravnborg
2006-09-26 4:11 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).