Re: [PATCH v2] send-email: only allow one address per body tag
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 23, 2017, 18:53 UTC
- Message-ID
- <xmqqfuj491sc.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <vpqo9xxkqqo.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 28 quoted lines
> Johan Hovold <johan@kernel.org> writes:
>
>> --- a/git-send-email.perl
>> +++ b/git-send-email.perl
>> @@ -1563,7 +1563,7 @@ foreach my $t (@files) {
>> # Now parse the message body
>> while(<$fh>) {
>> $message .= $_;
>> - if (/^(Signed-off-by|Cc): (.*)$/i) {
>> + if (/^(Signed-off-by|Cc): ([^>]*>?)/i) {
>
> I think this is acceptable, but this doesn't work with trailers like
>
> Cc: "Some > Body" <Some.Body@example.com>
>
> A proper management of this kind of weird address should be doable by
> reusing the regexp parsing "..." in parse_mailbox:
>
> my $re_quote = qr/"(?:[^\"\\]|\\.)*"/;
>
> So the final regex would look like
>
> if (/^(Signed-off-by|Cc): (([^>]*|"(?:[^\"\\]|\\.)*")>?)/i) {
>
> I don't think that should block the patch inclusion, but it may be worth
> considering.
>
> Anyway, thanks for the patch!Somehow this fell off the radar. So your reviewed-by: and then we'll cook this in 'next' for a while?
Thanks.