From: Jeff King Date: Wed, 25 Oct 2023 07:21:04 GMT Subject: Re: Regression: git send-email fails with "Use of uninitialized value $address" + "unable to extract a valid address" Message-ID: <20231025072104.GA2145145@coredump.intra.peff.net> In-Reply-To: <20231024204318.gi6b4ygqbilm2yke@pengutronix.de> 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 ' > 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 ' -1 Note that the bug will only trigger if Email::Valid is installed. 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. -Peff