Re: Regression: git send-email fails with "Use of uninitialized value $address" + "unable to extract a valid address"
- From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
- Date
- Oct 25, 2023, 07:40 UTC
- Message-ID
- <20231025074023.dowdv67urpjtzzka@pengutronix.de>
- In-Reply-To
- <20231025072104.GA2145145@coredump.intra.peff.net>
Hello,
On Wed, Oct 25, 2023 at 03:21:04AM -0400, Jeff King wrote:
Show 27 quoted lines
> On Tue, Oct 24, 2023 at 10:43:18PM +0200, Uwe Kleine-König wrote:
>
> > I debugged a bit and if I do
> >
> > mv .git/hooks/sendemail-validate .git/hooks/sendemail-validate.bak
> >
> > git send-email --to 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>'
> > starts to work for me, too.
> >
> > I'd guess the content of my sendemail-validate script doesn't matter
> > much, but for the record, it's:
> >
> > #!/bin/sh
> > # installed by patatt install-hook
> > patatt sign --hook "${1}"
> >
> > Does the problem reproduce on your end with a sendemail-validate script?
>
> I can reproduce with:
>
> git init
> echo foo >file && git add file && git commit -m foo
> echo 'exit 0' >.git/hooks/sendemail-validate
> chmod +x .git/hooks/sendemail-validate
> git send-email --dry-run --to='pëff <peff@peff.net>' -1
>
> Note that the bug will only trigger if Email::Valid is installed.I can confirm I have this package installed (via Debian's libemail-valid-perl).
Show 9 quoted lines
> I think this is the same issue being discussed elsewhere. The call to > process_address_list() sanitizes it to use rfc2047 encoding, which is > necessary for it to be syntactically valid. > > So the patch to move the validation later in the process here: > > https://lore.kernel.org/git/ee56c4df-e030-45f9-86a9-94fb3540db60@amd.com/ > > fixes it.
Tested and indeed that fixes my usecase. With that patch also the original regression is fixed and I can do
git send-email -1 --to 'Uwe Kleine-König <u.kleine-koenig@pengutronix.de>, pëff <peff@peff.net>'
again. \o/
Thanks Uwe
-- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |