Skip to contentSkip to conversation

get_maintainer.pl sends bogus addresses to git send-email

DISCUSSION Olaf Hering 3 participants 8 messages Apr 7, 2020 – Apr 8, 2020

lore
Share & tools
lore
#0 lore raw

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])>

#1 lore raw
Quoted 9 lines · Olaf Hering

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

#2 lore raw
Quoted 7 lines · Jeff King
Quoted 5 lines · Olaf Hering

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.

Quoted 8 lines
Quoted 4 lines

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]
#3 lore raw

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

Quoted 1 line

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

#4 lore raw
Quoted 7 lines · Olaf Hering

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

Quoted 1 line

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.

#5 lore raw
In reply to Joe Perches
Quoted 17 lines · Joe Perches
Quoted 7 lines · Jeff King
Quoted 5 lines · Olaf Hering

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.

Quoted 8 lines
Quoted 4 lines

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.

Quoted 5 lines

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).

Quoted 8 lines

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.

Quoted 1 line

[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

#6 lore raw
Quoted 22 lines · Jeff King
Quoted 20 lines · Joe Perches
Quoted 7 lines · Jeff King
Quoted 5 lines · Olaf Hering

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.

Quoted 8 lines
Quoted 4 lines

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

Quoted 8 lines
Quoted 2 lines

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.

Quoted 4 lines
Quoted 1 line

[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

#7 lore raw
Quoted 6 lines · Joe Perches
Quoted 2 lines

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.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

[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