# get_maintainer.pl sends bogus addresses to git send-email

8 messages from 2020-04-07 to 2020-04-08. Participants: Olaf Hering, Jeff King, Joe Perches.
Thread: https://gitlist.dev/t/53177

## Olaf Hering, 2020-04-07 15:40

Subject: get_maintainer.pl sends bogus addresses to git send-email
Message-ID: <20200407154046.GA15368@aepfle.de>
URL: https://gitlist.dev/e/20200407154046.GA15368%40aepfle.de

```
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, 2020-04-07 17:02

Subject: Re: get_maintainer.pl sends bogus addresses to git send-email
Message-ID: <20200407170257.GA1844923@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20200407170257.GA1844923%40coredump.intra.peff.net
In-Reply-To: <20200407154046.GA15368@aepfle.de>

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

-Peff

```

## Joe Perches, 2020-04-07 17:18

Subject: Re: get_maintainer.pl sends bogus addresses to git send-email
Message-ID: <2e6975d606846c834a387c07ee11cdce52356586.camel@perches.com>
URL: https://gitlist.dev/e/2e6975d606846c834a387c07ee11cdce52356586.camel%40perches.com
In-Reply-To: <20200407170257.GA1844923@coredump.intra.peff.net>

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


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, 2020-04-07 17:29

Subject: Re: get_maintainer.pl sends bogus addresses to git send-email
Message-ID: <20200407192949.586159e7.olaf@aepfle.de>
URL: https://gitlist.dev/e/20200407192949.586159e7.olaf%40aepfle.de
In-Reply-To: <2e6975d606846c834a387c07ee11cdce52356586.camel@perches.com>

```
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, 2020-04-07 17:39

Subject: Re: get_maintainer.pl sends bogus addresses to git send-email
Message-ID: <5d05fca7bcdeb57ed31fbbfc66d4cf7224e56f92.camel@perches.com>
URL: https://gitlist.dev/e/5d05fca7bcdeb57ed31fbbfc66d4cf7224e56f92.camel%40perches.com
In-Reply-To: <20200407192949.586159e7.olaf@aepfle.de>

```
On Tue, 2020-04-07 at 19:29 +0200, Olaf Hering wrote:
> 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, 2020-04-07 17:44

Subject: Re: get_maintainer.pl sends bogus addresses to git send-email
Message-ID: <20200407174449.GA1884106@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20200407174449.GA1884106%40coredump.intra.peff.net
In-Reply-To: <2e6975d606846c834a387c07ee11cdce52356586.camel@perches.com>

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

> 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, 2020-04-07 21:56

Subject: Re: get_maintainer.pl sends bogus addresses to git send-email
Message-ID: <2afc201cea5fd59829ce818041b4290a0ec5bb8c.camel@perches.com>
URL: https://gitlist.dev/e/2afc201cea5fd59829ce818041b4290a0ec5bb8c.camel%40perches.com
In-Reply-To: <20200407174449.GA1884106@coredump.intra.peff.net>

```
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/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, 2020-04-08 17:28

Subject: Re: get_maintainer.pl sends bogus addresses to git send-email
Message-ID: <20200408172853.GA1961925@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20200408172853.GA1961925%40coredump.intra.peff.net
In-Reply-To: <2afc201cea5fd59829ce818041b4290a0ec5bb8c.camel@perches.com>

```
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:

  Muhammed.Ali@Vegas.WBA

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

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

```
