2020-04-07 15:54:12

by Olaf Hering

[permalink] [raw]
Subject: get_maintainer.pl sends bogus addresses to git send-email

For me sending patches via git send-email fails because email address
conversion is failing. Something appends a ')' to x86/[email protected].
I suspect the double '))' in MAINTAINERS is confusing the command.
I tried to send the trivial patch from v5.0 and v5.6 tag.

Is this a failure in ./scripts/get_maintainer.pl,
or is this something git does internally?
I'm sure others use such command on a daily basis, so likely something on
my end became broken at some point in the past.

Olaf

linux.git $ git send-email --reroll-count 1 --confirm=always --annotate --to-cmd ./scripts/get_maintainer.pl HEAD^

(mbox) Adding cc: Olaf Hering <[email protected]> from line 'From: Olaf Hering <[email protected]>'
(body) Adding cc: Olaf Hering <[email protected]> from line 'Signed-off-by: Olaf Hering <[email protected]>'
(to-cmd) Adding to: "K. Y. Srinivasan" <[email protected]> from: './scripts/get_maintainer.pl'
(to-cmd) Adding to: Haiyang Zhang <[email protected]> from: './scripts/get_maintainer.pl'
(to-cmd) Adding to: Stephen Hemminger <[email protected]> from: './scripts/get_maintainer.pl'
(to-cmd) Adding to: Sasha Levin <[email protected]> from: './scripts/get_maintainer.pl'
(to-cmd) Adding to: Thomas Gleixner <[email protected]> from: './scripts/get_maintainer.pl'
(to-cmd) Adding to: Ingo Molnar <[email protected]> from: './scripts/get_maintainer.pl'
(to-cmd) Adding to: Borislav Petkov <[email protected]> from: './scripts/get_maintainer.pl'
(to-cmd) Adding to: "H. Peter Anvin" <[email protected]> from: './scripts/get_maintainer.pl'
(to-cmd) Adding to: [email protected] (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) from: './scripts/get_maintainer.pl'
(to-cmd) Adding to: [email protected] (open list:Hyper-V CORE AND DRIVERS) from: './scripts/get_maintainer.pl'
(to-cmd) Adding to: [email protected] (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)) from: './scripts/get_maintainer.pl'

From: Olaf Hering <[email protected]>
To: "K. Y. Srinivasan" <[email protected]>,
Haiyang Zhang <[email protected]>,
Stephen Hemminger <[email protected]>,
Sasha Levin <[email protected]>,
Thomas Gleixner <[email protected]>,
Ingo Molnar <[email protected]>,
Borislav Petkov <[email protected]>,
"H. Peter Anvin" <[email protected]>,
[email protected]) (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
[email protected] (open list:Hyper-V CORE AND DRIVERS),
[email protected]) (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)
Cc: Olaf Hering <[email protected]>
X-Mailer: git-send-email 2.16.4
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Send this email? ([y]es|[n]o|[q]uit|[a]ll): y
5.1.3 Invalid character in domain: <[email protected])>


Attachments:
(No filename) (2.73 kB)
signature.asc (849.00 B)
Download all attachments

2020-04-07 17:11:50

by Jeff King

[permalink] [raw]
Subject: Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, Apr 07, 2020 at 05:40:46PM +0200, Olaf Hering wrote:

> For me sending patches via git send-email fails because email address
> conversion is failing. Something appends a ')' to x86/[email protected].
> I suspect the double '))' in MAINTAINERS is confusing the command.
> I tried to send the trivial patch from v5.0 and v5.6 tag.
>
> Is this a failure in ./scripts/get_maintainer.pl,
> or is this something git does internally?
> I'm sure others use such command on a daily basis, so likely something on
> my end became broken at some point in the past.

It's a bug in send-email's hand-rolled address parser, which was fixed
in bd869f67b9 (send-email: add and use a local copy of Mail::Address,
2018-01-05). Upgrade to Git v2.17.0 or newer.

-Peff

2020-04-07 17:21:39

by Joe Perches

[permalink] [raw]
Subject: Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, 2020-04-07 at 13:02 -0400, Jeff King wrote:
> On Tue, Apr 07, 2020 at 05:40:46PM +0200, Olaf Hering wrote:
>
> > For me sending patches via git send-email fails because email address
> > conversion is failing. Something appends a ')' to x86/[email protected].
> > I suspect the double '))' in MAINTAINERS is confusing the command.
> > I tried to send the trivial patch from v5.0 and v5.6 tag.
> >
> > Is this a failure in ./scripts/get_maintainer.pl,
> > or is this something git does internally?
> > I'm sure others use such command on a daily basis, so likely something on
> > my end became broken at some point in the past.
>
> It's a bug in send-email's hand-rolled address parser, which was fixed
> in bd869f67b9 (send-email: add and use a local copy of Mail::Address,
> 2018-01-05). Upgrade to Git v2.17.0 or newer.

Not really.
You need to add --norolestats on the get_maintainer command line

git send-email expects bare email addresses, not ones annotated
with additional content.


For instance:

$ ./scripts/get_maintainer.pl -f lib/vsprintf.c
Petr Mladek <[email protected]> (maintainer:VSPRINTF)
Steven Rostedt <[email protected]> (maintainer:VSPRINTF)
Sergey Senozhatsky <[email protected]> (maintainer:VSPRINTF)
Andy Shevchenko <[email protected]> (reviewer:VSPRINTF)
Rasmus Villemoes <[email protected]> (reviewer:VSPRINTF)
[email protected] (open list)

vs:

$ ./scripts/get_maintainer.pl -f --norolestats lib/vsprintf.c
Petr Mladek <[email protected]>
Steven Rostedt <[email protected]>
Sergey Senozhatsky <[email protected]>
Andy Shevchenko <[email protected]>
Rasmus Villemoes <[email protected]>
[email protected]


2020-04-07 17:30:55

by Olaf Hering

[permalink] [raw]
Subject: Re: get_maintainer.pl sends bogus addresses to git send-email

Am Tue, 07 Apr 2020 10:18:41 -0700
schrieb Joe Perches <[email protected]>:

> You need to add --norolestats on the get_maintainer command line

Thanks, this can be used as a workaround for the time being.
Not sure why anyone would actually care about such details in default mode...


Olaf


Attachments:
(No filename) (849.00 B)
Digitale Signatur von OpenPGP

2020-04-07 17:43:01

by Joe Perches

[permalink] [raw]
Subject: Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, 2020-04-07 at 19:29 +0200, Olaf Hering wrote:
> Am Tue, 07 Apr 2020 10:18:41 -0700
> schrieb Joe Perches <[email protected]>:
>
> > You need to add --norolestats on the get_maintainer command line
>
> Thanks, this can be used as a workaround for the time being.
> Not sure why anyone would actually care about such details in default mode...

Because the default is
"tell me more about the maintainers of a particular file".
which can include not just the default maintainers of
a particular file within a subsystem, but the also info
about the people that actually apply patches to files.

For instance, a patch made to a file often has a nominal
maintainer that doesn't actually apply the patches but
that maintainer may review or approve but not actually
be the upstream path for acceptance of the patch.



2020-04-07 17:47:00

by Jeff King

[permalink] [raw]
Subject: Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, Apr 07, 2020 at 10:18:41AM -0700, Joe Perches wrote:

> On Tue, 2020-04-07 at 13:02 -0400, Jeff King wrote:
> > On Tue, Apr 07, 2020 at 05:40:46PM +0200, Olaf Hering wrote:
> >
> > > For me sending patches via git send-email fails because email address
> > > conversion is failing. Something appends a ')' to x86/[email protected].
> > > I suspect the double '))' in MAINTAINERS is confusing the command.
> > > I tried to send the trivial patch from v5.0 and v5.6 tag.
> > >
> > > Is this a failure in ./scripts/get_maintainer.pl,
> > > or is this something git does internally?
> > > I'm sure others use such command on a daily basis, so likely something on
> > > my end became broken at some point in the past.
> >
> > It's a bug in send-email's hand-rolled address parser, which was fixed
> > in bd869f67b9 (send-email: add and use a local copy of Mail::Address,
> > 2018-01-05). Upgrade to Git v2.17.0 or newer.
>
> Not really.
> You need to add --norolestats on the get_maintainer command line
>
> git send-email expects bare email addresses, not ones annotated
> with additional content.

I agree that dropping them from the output is even better, if you'd
never want them to be sent.

Syntactically they are rfc822 comments, and send-email _should_ be able
to handle them (and does in recent versions).

> For instance:
>
> $ ./scripts/get_maintainer.pl -f lib/vsprintf.c
> Petr Mladek <[email protected]> (maintainer:VSPRINTF)
> Steven Rostedt <[email protected]> (maintainer:VSPRINTF)
> Sergey Senozhatsky <[email protected]> (maintainer:VSPRINTF)
> Andy Shevchenko <[email protected]> (reviewer:VSPRINTF)
> Rasmus Villemoes <[email protected]> (reviewer:VSPRINTF)

In all of these cases send-email will drop the bit in parentheses.

> [email protected] (open list)

In this one, I think that the comment will be used as the name field,
since there isn't one.

-Peff

2020-04-07 21:59:41

by Joe Perches

[permalink] [raw]
Subject: Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, 2020-04-07 at 13:44 -0400, Jeff King wrote:
> On Tue, Apr 07, 2020 at 10:18:41AM -0700, Joe Perches wrote:
>
> > On Tue, 2020-04-07 at 13:02 -0400, Jeff King wrote:
> > > On Tue, Apr 07, 2020 at 05:40:46PM +0200, Olaf Hering wrote:
> > >
> > > > For me sending patches via git send-email fails because email address
> > > > conversion is failing. Something appends a ')' to x86/[email protected].
> > > > I suspect the double '))' in MAINTAINERS is confusing the command.
> > > > I tried to send the trivial patch from v5.0 and v5.6 tag.
> > > >
> > > > Is this a failure in ./scripts/get_maintainer.pl,
> > > > or is this something git does internally?
> > > > I'm sure others use such command on a daily basis, so likely something on
> > > > my end became broken at some point in the past.
> > >
> > > It's a bug in send-email's hand-rolled address parser, which was fixed
> > > in bd869f67b9 (send-email: add and use a local copy of Mail::Address,
> > > 2018-01-05). Upgrade to Git v2.17.0 or newer.
> >
> > Not really.
> > You need to add --norolestats on the get_maintainer command line
> >
> > git send-email expects bare email addresses, not ones annotated
> > with additional content.
>
> I agree that dropping them from the output is even better, if you'd
> never want them to be sent.
>
> Syntactically they are rfc822 comments, and send-email _should_ be able
> to handle them (and does in recent versions).

I'm not certain that comments are allowed _after_ a tld in an
email address. In any case, I guess it's a good thing I used
parentheses for the get_maintainer rolestats block.

> > [email protected] (open list)
>
> In this one, I think that the comment will be used as the name field,
> since there isn't one.

I think that slightly unexpected as the name field is not required.

cheers, Joe

2020-04-08 21:21:46

by Jeff King

[permalink] [raw]
Subject: Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, Apr 07, 2020 at 02:56:19PM -0700, Joe Perches wrote:

> > Syntactically they are rfc822 comments, and send-email _should_ be able
> > to handle them (and does in recent versions).
>
> I'm not certain that comments are allowed _after_ a tld in an
> email address. In any case, I guess it's a good thing I used
> parentheses for the get_maintainer rolestats block.

Oh, it's much more horrible than that. RFC822 contains this example:

Muhammed.(I am the greatest) Ali @(the)Vegas.WBA

which parses to:

[email protected]

Perl's Mail::Address does decipher that correctly.

> > > [email protected] (open list)
> >
> > In this one, I think that the comment will be used as the name field,
> > since there isn't one.
>
> I think that slightly unexpected as the name field is not required.

TBH, so do I. That's all done by Mail::Address's format() method. We
could probably convince it to be less magical, but perhaps it's best to
just leave it alone. Presumably that logic has some historical basis,
and as you note, it's a mistake to be passing these fields into
send-email in the first place.

-Peff