threads / discuss / 53177

get_maintainer.pl sends bogus addresses to git send-email

Subject: get_maintainer.pl sends bogus addresses to git send-email

## tl;dr

8 messages between Apr 7, 2020 and Apr 8, 2020.

replies: 7people: 3as markdown or json

Olaf Hering· Apr 7, 2020, 15:40 UTC · lore

For me sending patches via git send-email fails because email address conversion is failing. Something appends a ')' to x86/lkml@kernel.org. 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 <olaf@aepfle.de> from line 'From: Olaf Hering <olaf@aepfle.de>' (body) Adding cc: Olaf Hering <olaf@aepfle.de> from line 'Signed-off-by: Olaf Hering <olaf@aepfle.de>' (to-cmd) Adding to: "K. Y. Srinivasan" <kys@microsoft.com> from: './scripts/get_maintainer.pl' (to-cmd) Adding to: Haiyang Zhang <haiyangz@microsoft.com> from: './scripts/get_maintainer.pl' (to-cmd) Adding to: Stephen Hemminger <sthemmin@microsoft.com> from: './scripts/get_maintainer.pl' (to-cmd) Adding to: Sasha Levin <sashal@kernel.org> from: './scripts/get_maintainer.pl' (to-cmd) Adding to: Thomas Gleixner <tglx@linutronix.de> from: './scripts/get_maintainer.pl' (to-cmd) Adding to: Ingo Molnar <mingo@redhat.com> from: './scripts/get_maintainer.pl' (to-cmd) Adding to: Borislav Petkov <bp@alien8.de> from: './scripts/get_maintainer.pl' (to-cmd) Adding to: "H. Peter Anvin" <hpa@zytor.com> from: './scripts/get_maintainer.pl' (to-cmd) Adding to: x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) from: './scripts/get_maintainer.pl' (to-cmd) Adding to: devel@linuxdriverproject.org (open list:Hyper-V CORE AND DRIVERS) from: './scripts/get_maintainer.pl' (to-cmd) Adding to: linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)) from: './scripts/get_maintainer.pl'

From: Olaf Hering <olaf@aepfle.de>
To: "K. Y. Srinivasan" <kys@microsoft.com>,
        Haiyang Zhang <haiyangz@microsoft.com>,
        Stephen Hemminger <sthemmin@microsoft.com>,
        Sasha Levin <sashal@kernel.org>,
        Thomas Gleixner <tglx@linutronix.de>,
        Ingo Molnar <mingo@redhat.com>,
        Borislav Petkov <bp@alien8.de>,
        "H. Peter Anvin" <hpa@zytor.com>,
        x86@kernel.org) (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
        devel@linuxdriverproject.org (open list:Hyper-V CORE AND DRIVERS),
        linux-kernel@vger.kernel.org) (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)
Cc: Olaf Hering <olaf@aepfle.de>
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: <x86@kernel.org)>

Jeff King· Apr 7, 2020, 17:02 UTC · re: Olaf Hering · lore

Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, Apr 07, 2020 at 05:40:46PM +0200, Olaf Hering wrote:
Show 9 quoted lines
> For me sending patches via git send-email fails because email address
> conversion is failing. Something appends a ')' to x86/lkml@kernel.org.
> 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
Joe Perches· Apr 7, 2020, 17:18 UTC · re: Jeff King · lore

Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, 2020-04-07 at 13:02 -0400, Jeff King wrote:
Show 15 quoted lines
> 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/lkml@kernel.org.
> > 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 <pmladek@suse.com> (maintainer:VSPRINTF) Steven Rostedt <rostedt@goodmis.org> (maintainer:VSPRINTF) Sergey Senozhatsky <sergey.senozhatsky@gmail.com> (maintainer:VSPRINTF) Andy Shevchenko <andriy.shevchenko@linux.intel.com> (reviewer:VSPRINTF) Rasmus Villemoes <linux@rasmusvillemoes.dk> (reviewer:VSPRINTF) linux-kernel@vger.kernel.org (open list)

vs:

$ ./scripts/get_maintainer.pl -f --norolestats lib/vsprintf.c Petr Mladek <pmladek@suse.com> Steven Rostedt <rostedt@goodmis.org> Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Andy Shevchenko <andriy.shevchenko@linux.intel.com> Rasmus Villemoes <linux@rasmusvillemoes.dk> linux-kernel@vger.kernel.org

Olaf Hering· Apr 7, 2020, 17:29 UTC · re: Joe Perches · lore

Re: get_maintainer.pl sends bogus addresses to git send-email

Am Tue, 07 Apr 2020 10:18:41 -0700 schrieb Joe Perches <joe@perches.com>:

> 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
Joe Perches· Apr 7, 2020, 17:39 UTC · re: Olaf Hering · lore

Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, 2020-04-07 at 19:29 +0200, Olaf Hering wrote:
Show 7 quoted lines
> Am Tue, 07 Apr 2020 10:18:41 -0700
> schrieb Joe Perches <joe@perches.com>:
> 
> > 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.

Jeff King· Apr 7, 2020, 17:44 UTC · re: Joe Perches · lore

Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, Apr 07, 2020 at 10:18:41AM -0700, Joe Perches wrote:
Show 22 quoted lines
> 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/lkml@kernel.org.
> > > 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).

Show 8 quoted lines
> For instance:
> 
> $ ./scripts/get_maintainer.pl -f lib/vsprintf.c
> Petr Mladek <pmladek@suse.com> (maintainer:VSPRINTF)
> Steven Rostedt <rostedt@goodmis.org> (maintainer:VSPRINTF)
> Sergey Senozhatsky <sergey.senozhatsky@gmail.com> (maintainer:VSPRINTF)
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> (reviewer:VSPRINTF)
> Rasmus Villemoes <linux@rasmusvillemoes.dk> (reviewer:VSPRINTF)
In all of these cases send-email will drop the bit in parentheses.
> linux-kernel@vger.kernel.org (open list)

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

-Peff
Joe Perches· Apr 7, 2020, 21:56 UTC · re: Jeff King · lore

Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, 2020-04-07 at 13:44 -0400, Jeff King wrote:
Show 30 quoted lines
> 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/lkml@kernel.org.
> > > > 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.

> > linux-kernel@vger.kernel.org (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
Jeff King· Apr 8, 2020, 17:28 UTC · re: Joe Perches · lore

Re: get_maintainer.pl sends bogus addresses to git send-email

On Tue, Apr 07, 2020 at 02:56:19PM -0700, Joe Perches wrote:
Show 6 quoted 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:
  Muhammed.Ali@Vegas.WBA
Perl's Mail::Address does decipher that correctly.
Show 6 quoted lines
> > > linux-kernel@vger.kernel.org (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

← back to recent threads