* [REGRESSION] uninitialized value $address in git send-email
@ 2023-09-18 12:56 Bagas Sanjaya
2023-09-18 16:35 ` [PATCH] git-send-email.perl: avoid printing undef when validating addresses Taylor Blau
2023-09-18 20:26 ` [REGRESSION] uninitialized value $address in git send-email Michael Strawbridge
0 siblings, 2 replies; 12+ messages in thread
From: Bagas Sanjaya @ 2023-09-18 12:56 UTC (permalink / raw)
To: Michael Strawbridge, Junio C Hamano, Luben Tuikov,
Ævar Arnfjörð Bjarmason, Emily Shaffer,
Doug Anderson
Cc: Git Mailing List
[-- Attachment #1: Type: text/plain, Size: 2037 bytes --]
Hi,
Recently when I was submitting doc fixes to linux-doc mailing list [1]
using git-send-email(1), I got perl-related error:
```
Use of uninitialized value $address in sprintf at /home/bagas/.app/git/dist/v2.42.0/libexec/git-core/git-send-email line 1172.
error: unable to extract a valid address from:
```
My linux.git clone has sendemail-validate hook which uses patatt (from b4
package). The hook is:
```
#!/bin/sh
# installed by patatt install-hook
patatt sign --hook "${1}"
```
This issue occurs on Git v2.41.0 but not in v2.40.0. Bisecting, the culprit is
commit a8022c5f7b67 (send-email: expose header information to git-send-email's
sendemail-validate hook, 2023-04-19). Emily's earlier report [2] also points to
the same culprit, but with different bug.
I triggered this issue on patch series with cover letter. To reproduce:
1. Clone git.git repo, then branch off:
```
$ git clone https://github.com/git/git.git && cd git
$ git checkout -b test
```
2. Make two dummy signed-off commits:
```
$ echo test > test && git add test && git commit -s -m "test"
$ echo "test test" >> test && git commit -a -s -m "test test"
```
3. Generate patch series:
```
$ mkdir /tmp/test
$ git format-patch -o /tmp/test --cover-letter main
```
4. Send the series to dummy address:
```
$ git send-email --to="pi <pi@pi>" /tmp/test/*.patch
```
git-send-email(1) trips on the cover letter since there is no recipient
addresses detected. It also errored out on patches without Signed-off-by
trailer. When the command should have been succeeded, I expected that it
asked me whether to send each patch or not.
My system runs Debian testing (trixie/sid) with perl 5.36.0.
Thanks.
[1]: https://lore.kernel.org/linux-doc/20230918093240.29824-1-bagasdotme@gmail.com/
[2]: https://lore.kernel.org/git/CAJoAoZ=GGgjGOeaeo6RFBO7=6msdRf-Ze6XcnL04K5ugupLUJA@mail.gmail.com/
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] git-send-email.perl: avoid printing undef when validating addresses
2023-09-18 12:56 [REGRESSION] uninitialized value $address in git send-email Bagas Sanjaya
@ 2023-09-18 16:35 ` Taylor Blau
2023-09-18 19:04 ` Junio C Hamano
2023-09-18 21:20 ` Jeff King
2023-09-18 20:26 ` [REGRESSION] uninitialized value $address in git send-email Michael Strawbridge
1 sibling, 2 replies; 12+ messages in thread
From: Taylor Blau @ 2023-09-18 16:35 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jeff King, Bagas Sanjaya
When validating email addresses with `extract_valid_address_or_die()`,
we print out a helpful error message when the given input does not
contain a valid email address.
However, the pre-image of this patch looks something like:
my $address = shift;
$address = extract_valid_address($address):
die sprintf(__("..."), $address) if !$address;
which fails when given a bogus email address by trying to use $address
(which is undef) in a sprintf() expansion, like so:
$ git.compile send-email --to="pi <pi@pi>" /tmp/x/*.patch --force
Use of uninitialized value $address in sprintf at /home/ttaylorr/src/git/git-send-email line 1175.
error: unable to extract a valid address from:
This regression dates back to e431225569 (git-send-email: remove invalid
addresses earlier, 2012-11-22), but became more noticeable in a8022c5f7b
(send-email: expose header information to git-send-email's
sendemail-validate hook, 2023-04-19), which validates SMTP headers in
the sendemail-validate hook.
Avoid trying to format an undef by storing the given and cleaned address
separately. After applying this fix, the error contains the invalid
email address, and the warning disappears:
$ git.compile send-email --to="pi <pi@pi>" /tmp/x/*.patch --force
error: unable to extract a valid address from: pi <pi@pi>
Reported-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
git-send-email.perl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 897cea6564..288ea1ae80 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1166,10 +1166,10 @@ sub extract_valid_address {
sub extract_valid_address_or_die {
my $address = shift;
- $address = extract_valid_address($address);
+ my $valid_address = extract_valid_address($address);
die sprintf(__("error: unable to extract a valid address from: %s\n"), $address)
- if !$address;
- return $address;
+ if !$valid_address;
+ return $valid_address;
}
sub validate_address {
--
2.42.0.217.g5402a90ddb
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] git-send-email.perl: avoid printing undef when validating addresses
2023-09-18 16:35 ` [PATCH] git-send-email.perl: avoid printing undef when validating addresses Taylor Blau
@ 2023-09-18 19:04 ` Junio C Hamano
2023-09-18 21:20 ` Jeff King
1 sibling, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2023-09-18 19:04 UTC (permalink / raw)
To: Taylor Blau; +Cc: git, Jeff King, Bagas Sanjaya
Taylor Blau <me@ttaylorr.com> writes:
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 897cea6564..288ea1ae80 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -1166,10 +1166,10 @@ sub extract_valid_address {
>
> sub extract_valid_address_or_die {
> my $address = shift;
> + my $valid_address = extract_valid_address($address);
> die sprintf(__("error: unable to extract a valid address from: %s\n"), $address)
> + if !$valid_address;
> + return $valid_address;
This will still use undef if the incoming $address is already undef,
but the caller deserves what it gets in such a case. The message
reports that the %s is the source from which the code tried to
extract the address from, not the result of failed extraction, so
the rewrite is absolutely the right thing to do.
Will queue. Thanks.
> }
>
> sub validate_address {
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [REGRESSION] uninitialized value $address in git send-email
2023-09-18 12:56 [REGRESSION] uninitialized value $address in git send-email Bagas Sanjaya
2023-09-18 16:35 ` [PATCH] git-send-email.perl: avoid printing undef when validating addresses Taylor Blau
@ 2023-09-18 20:26 ` Michael Strawbridge
2023-09-19 4:44 ` Bagas Sanjaya
1 sibling, 1 reply; 12+ messages in thread
From: Michael Strawbridge @ 2023-09-18 20:26 UTC (permalink / raw)
To: Bagas Sanjaya, Junio C Hamano, Luben Tuikov,
Ævar Arnfjörð Bjarmason, Emily Shaffer,
Doug Anderson
Cc: Git Mailing List
Hi,
Author of a8022c5f7b67 (send-email: expose header information to
git-send-email's sendemail-validate hook, 2023-04-19) here.
On 2023-09-18 08:56, Bagas Sanjaya wrote:
> Hi,
>
> Recently when I was submitting doc fixes to linux-doc mailing list [1]
> using git-send-email(1), I got perl-related error:
>
> ```
> Use of uninitialized value $address in sprintf at /home/bagas/.app/git/dist/v2.42.0/libexec/git-core/git-send-email line 1172.
> error: unable to extract a valid address from:
> ```
>
> My linux.git clone has sendemail-validate hook which uses patatt (from b4
> package). The hook is:
>
> ```
> #!/bin/sh
> # installed by patatt install-hook
> patatt sign --hook "${1}"
> ```
>
> This issue occurs on Git v2.41.0 but not in v2.40.0. Bisecting, the culprit is
> commit a8022c5f7b67 (send-email: expose header information to git-send-email's
> sendemail-validate hook, 2023-04-19). Emily's earlier report [2] also points to
> the same culprit, but with different bug.
>
> I triggered this issue on patch series with cover letter. To reproduce:
>
> 1. Clone git.git repo, then branch off:
>
> ```
> $ git clone https://github.com/git/git.git && cd git
> $ git checkout -b test
> ```
>
> 2. Make two dummy signed-off commits:
>
> ```
> $ echo test > test && git add test && git commit -s -m "test"
> $ echo "test test" >> test && git commit -a -s -m "test test"
> ```
>
> 3. Generate patch series:
>
> ```
> $ mkdir /tmp/test
> $ git format-patch -o /tmp/test --cover-letter main
> ```
>
> 4. Send the series to dummy address:
>
> ```
> $ git send-email --to="pi <pi@pi>" /tmp/test/*.patch
> ```
I tried to repro this today on my side. I can repro the error when
using the address "pi <pi@pi>" but that's not a valid email address and
so one would expect it to fail in the extract_valid_address_or_die
function with the error that you mention. As soon as I make the address
valid like "pi <pi@pi.com>", git send-email no longer complains.
In your original case, are you trying to send email to an invalid email
address? Is it an alias by chance?
Thanks.
> git-send-email(1) trips on the cover letter since there is no recipient
> addresses detected. It also errored out on patches without Signed-off-by
> trailer. When the command should have been succeeded, I expected that it
> asked me whether to send each patch or not.
>
> My system runs Debian testing (trixie/sid) with perl 5.36.0.
>
> Thanks.
>
> [1]: https://lore.kernel.org/linux-doc/20230918093240.29824-1-bagasdotme@gmail.com/
> [2]: https://lore.kernel.org/git/CAJoAoZ=GGgjGOeaeo6RFBO7=6msdRf-Ze6XcnL04K5ugupLUJA@mail.gmail.com/
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git-send-email.perl: avoid printing undef when validating addresses
2023-09-18 16:35 ` [PATCH] git-send-email.perl: avoid printing undef when validating addresses Taylor Blau
2023-09-18 19:04 ` Junio C Hamano
@ 2023-09-18 21:20 ` Jeff King
1 sibling, 0 replies; 12+ messages in thread
From: Jeff King @ 2023-09-18 21:20 UTC (permalink / raw)
To: Taylor Blau; +Cc: git, Junio C Hamano, Bagas Sanjaya
On Mon, Sep 18, 2023 at 12:35:53PM -0400, Taylor Blau wrote:
> When validating email addresses with `extract_valid_address_or_die()`,
> we print out a helpful error message when the given input does not
> contain a valid email address.
>
> However, the pre-image of this patch looks something like:
>
> my $address = shift;
> $address = extract_valid_address($address):
> die sprintf(__("..."), $address) if !$address;
>
> which fails when given a bogus email address by trying to use $address
> (which is undef) in a sprintf() expansion, like so:
>
> $ git.compile send-email --to="pi <pi@pi>" /tmp/x/*.patch --force
> Use of uninitialized value $address in sprintf at /home/ttaylorr/src/git/git-send-email line 1175.
> error: unable to extract a valid address from:
Yeah, we overwrite the variable we're reporting on, so I don't think the
original could possibly work. Your fix makes sense.
> This regression dates back to e431225569 (git-send-email: remove invalid
> addresses earlier, 2012-11-22), but became more noticeable in a8022c5f7b
> (send-email: expose header information to git-send-email's
> sendemail-validate hook, 2023-04-19), which validates SMTP headers in
> the sendemail-validate hook.
I didn't quite understand how a8022c5f7b made this worse, but I guess we
just call it the bad function in more instances. The bug is definitely
from e431225569, though.
-Peff
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [REGRESSION] uninitialized value $address in git send-email
2023-09-18 20:26 ` [REGRESSION] uninitialized value $address in git send-email Michael Strawbridge
@ 2023-09-19 4:44 ` Bagas Sanjaya
2023-09-19 14:04 ` Michael Strawbridge
0 siblings, 1 reply; 12+ messages in thread
From: Bagas Sanjaya @ 2023-09-19 4:44 UTC (permalink / raw)
To: Michael Strawbridge, Junio C Hamano, Luben Tuikov,
Ævar Arnfjörð Bjarmason, Emily Shaffer,
Doug Anderson
Cc: Git Mailing List
[-- Attachment #1: Type: text/plain, Size: 1888 bytes --]
On Mon, Sep 18, 2023 at 04:26:44PM -0400, Michael Strawbridge wrote:
> Hi,
>
> Author of a8022c5f7b67 (send-email: expose header information to
> git-send-email's sendemail-validate hook, 2023-04-19) here.
>
> On 2023-09-18 08:56, Bagas Sanjaya wrote:
> > I triggered this issue on patch series with cover letter. To reproduce:
> >
> > 1. Clone git.git repo, then branch off:
> >
> > ```
> > $ git clone https://github.com/git/git.git && cd git
> > $ git checkout -b test
> > ```
> >
> > 2. Make two dummy signed-off commits:
> >
> > ```
> > $ echo test > test && git add test && git commit -s -m "test"
> > $ echo "test test" >> test && git commit -a -s -m "test test"
> > ```
> >
> > 3. Generate patch series:
> >
> > ```
> > $ mkdir /tmp/test
> > $ git format-patch -o /tmp/test --cover-letter main
> > ```
> >
> > 4. Send the series to dummy address:
> >
> > ```
> > $ git send-email --to="pi <pi@pi>" /tmp/test/*.patch
> > ```
>
> I tried to repro this today on my side. I can repro the error when
> using the address "pi <pi@pi>" but that's not a valid email address and
> so one would expect it to fail in the extract_valid_address_or_die
> function with the error that you mention. As soon as I make the address
> valid like "pi <pi@pi.com>", git send-email no longer complains.
>
> In your original case, are you trying to send email to an invalid email
> address? Is it an alias by chance?
I triggered this regression when I passed multiple addresses separated by comma
(like `--to="foo <foo@acme.com>,bar <bar@acme.com>"`, but somehow I managed to
reduce the trigger to one address only (in this case, "pi <pi@pi.com>"). As for
multiple addresses part, let me know if I should post another regression
report.
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [REGRESSION] uninitialized value $address in git send-email
2023-09-19 4:44 ` Bagas Sanjaya
@ 2023-09-19 14:04 ` Michael Strawbridge
2023-09-19 14:37 ` Michael Strawbridge
0 siblings, 1 reply; 12+ messages in thread
From: Michael Strawbridge @ 2023-09-19 14:04 UTC (permalink / raw)
To: Bagas Sanjaya, Junio C Hamano, Luben Tuikov,
Ævar Arnfjörð Bjarmason, Emily Shaffer,
Doug Anderson
Cc: Git Mailing List
On 2023-09-19 00:44, Bagas Sanjaya wrote:
> On Mon, Sep 18, 2023 at 04:26:44PM -0400, Michael Strawbridge wrote:
>> Hi,
>>
>> Author of a8022c5f7b67 (send-email: expose header information to
>> git-send-email's sendemail-validate hook, 2023-04-19) here.
>>
>> On 2023-09-18 08:56, Bagas Sanjaya wrote:
>>> I triggered this issue on patch series with cover letter. To reproduce:
>>>
>>> 1. Clone git.git repo, then branch off:
>>>
>>> ```
>>> $ git clone https://github.com/git/git.git && cd git
>>> $ git checkout -b test
>>> ```
>>>
>>> 2. Make two dummy signed-off commits:
>>>
>>> ```
>>> $ echo test > test && git add test && git commit -s -m "test"
>>> $ echo "test test" >> test && git commit -a -s -m "test test"
>>> ```
>>>
>>> 3. Generate patch series:
>>>
>>> ```
>>> $ mkdir /tmp/test
>>> $ git format-patch -o /tmp/test --cover-letter main
>>> ```
>>>
>>> 4. Send the series to dummy address:
>>>
>>> ```
>>> $ git send-email --to="pi <pi@pi>" /tmp/test/*.patch
>>> ```
>> I tried to repro this today on my side. I can repro the error when
>> using the address "pi <pi@pi>" but that's not a valid email address and
>> so one would expect it to fail in the extract_valid_address_or_die
>> function with the error that you mention. As soon as I make the address
>> valid like "pi <pi@pi.com>", git send-email no longer complains.
>>
>> In your original case, are you trying to send email to an invalid email
>> address? Is it an alias by chance?
> I triggered this regression when I passed multiple addresses separated by comma
> (like `--to="foo <foo@acme.com>,bar <bar@acme.com>"`, but somehow I managed to
> reduce the trigger to one address only (in this case, "pi <pi@pi.com>"). As for
> multiple addresses part, let me know if I should post another regression
> report.
>
Hm. I'm not sure what to say. I have used the below docker container
as a test environment and don't seem to find issues with 'git send-email
--to="pi <pi@pi.com>" /email/test/*.patch' nor with 'git send-email
--to="foo <foo@acme.com>,bar <bar@acme.com>" /email/test/*.patch'.
Maybe if you could try the following test environment too and see if you
can reproduce it inside the docker container:
NOTE: I assume you install docker on your system
Step 1) Create folder with the below files inside
Dockerfile:
...
FROM debian:trixie
RUN apt-get update && \
apt-get install -y git git-email vim
WORKDIR /
RUN git clone https://github.com/git/git.git && \
cd git && \
git checkout -b test
#COPY git-send-email /usr/lib/git-core/git-send-email
RUN git config --global user.email "you@example.com"
RUN git config --global user.name "Your Name"
#specific error case
RUN cd git && echo '#!/bin/sh \n\
patatt sign --hook "${1}"' > .git/hooks/sendemail-validate
RUN cd git && echo test > test && git add test && git commit -s -m "test"
RUN cd git && echo "test test" >> test && git commit -a -s -m "test test"
RUN mkdir -p /email/test
RUN cd git && git format-patch -o /email/test --cover-letter master
RUN sed -i 's/\*\*\* SUBJECT HERE \*\*\*/test/'
/email/test/0000-cover-letter.patch
...
run.sh:
...
#!/bin/sh
sudo docker stop git-send-email-debug
sudo docker rm git-send-email-debug
sudo docker build -t git-send-email-debug:latest .
sudo docker run -it --name git-send-email-debug git-send-email-debug:latest
...
Step 2) Make run.sh executable and start run.sh to create docker
container shell. Inside the container's shell (will pop up
automatically) please try this:
git send-email --to="foo <foo@acme.com>,bar <bar@acme.com>"
/email/test/*.patch
Please let me know the results of the test case above and any other
things you try that have interesting results.
Thank you!
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [REGRESSION] uninitialized value $address in git send-email
2023-09-19 14:04 ` Michael Strawbridge
@ 2023-09-19 14:37 ` Michael Strawbridge
2023-09-20 11:00 ` Bagas Sanjaya
2023-09-20 15:36 ` Junio C Hamano
0 siblings, 2 replies; 12+ messages in thread
From: Michael Strawbridge @ 2023-09-19 14:37 UTC (permalink / raw)
To: Bagas Sanjaya, Junio C Hamano, Luben Tuikov,
Ævar Arnfjörð Bjarmason, Emily Shaffer,
Doug Anderson
Cc: Git Mailing List
On 2023-09-19 10:04, Michael Strawbridge wrote:
> On 2023-09-19 00:44, Bagas Sanjaya wrote:
>> On Mon, Sep 18, 2023 at 04:26:44PM -0400, Michael Strawbridge wrote:
>>> Hi,
>>>
>>> Author of a8022c5f7b67 (send-email: expose header information to
>>> git-send-email's sendemail-validate hook, 2023-04-19) here.
>>>
>>> On 2023-09-18 08:56, Bagas Sanjaya wrote:
>>>> I triggered this issue on patch series with cover letter. To reproduce:
>>>>
>>>> 1. Clone git.git repo, then branch off:
>>>>
>>>> ```
>>>> $ git clone https://github.com/git/git.git && cd git
>>>> $ git checkout -b test
>>>> ```
>>>>
>>>> 2. Make two dummy signed-off commits:
>>>>
>>>> ```
>>>> $ echo test > test && git add test && git commit -s -m "test"
>>>> $ echo "test test" >> test && git commit -a -s -m "test test"
>>>> ```
>>>>
>>>> 3. Generate patch series:
>>>>
>>>> ```
>>>> $ mkdir /tmp/test
>>>> $ git format-patch -o /tmp/test --cover-letter main
>>>> ```
>>>>
>>>> 4. Send the series to dummy address:
>>>>
>>>> ```
>>>> $ git send-email --to="pi <pi@pi>" /tmp/test/*.patch
>>>> ```
>>> I tried to repro this today on my side. I can repro the error when
>>> using the address "pi <pi@pi>" but that's not a valid email address and
>>> so one would expect it to fail in the extract_valid_address_or_die
>>> function with the error that you mention. As soon as I make the address
>>> valid like "pi <pi@pi.com>", git send-email no longer complains.
>>>
>>> In your original case, are you trying to send email to an invalid email
>>> address? Is it an alias by chance?
>> I triggered this regression when I passed multiple addresses separated by comma
>> (like `--to="foo <foo@acme.com>,bar <bar@acme.com>"`, but somehow I managed to
>> reduce the trigger to one address only (in this case, "pi <pi@pi.com>"). As for
>> multiple addresses part, let me know if I should post another regression
>> report.
>>
> Hm. I'm not sure what to say. I have used the below docker container
> as a test environment and don't seem to find issues with 'git send-email
> --to="pi <pi@pi.com>" /email/test/*.patch' nor with 'git send-email
> --to="foo <foo@acme.com>,bar <bar@acme.com>" /email/test/*.patch'.
>
> Maybe if you could try the following test environment too and see if you
> can reproduce it inside the docker container:
>
> NOTE: I assume you install docker on your system
>
> Step 1) Create folder with the below files inside
>
> Dockerfile:
>
> ...
>
> FROM debian:trixie
>
> RUN apt-get update && \
> apt-get install -y git git-email vim
>
> WORKDIR /
>
> RUN git clone https://github.com/git/git.git && \
> cd git && \
> git checkout -b test
>
> #COPY git-send-email /usr/lib/git-core/git-send-email
>
> RUN git config --global user.email "you@example.com"
> RUN git config --global user.name "Your Name"
>
> #specific error case
> RUN cd git && echo '#!/bin/sh \n\
> patatt sign --hook "${1}"' > .git/hooks/sendemail-validate
>
> RUN cd git && echo test > test && git add test && git commit -s -m "test"
> RUN cd git && echo "test test" >> test && git commit -a -s -m "test test"
> RUN mkdir -p /email/test
> RUN cd git && git format-patch -o /email/test --cover-letter master
> RUN sed -i 's/\*\*\* SUBJECT HERE \*\*\*/test/'
> /email/test/0000-cover-letter.patch
>
> ...
>
>
> run.sh:
>
> ...
>
> #!/bin/sh
>
> sudo docker stop git-send-email-debug
> sudo docker rm git-send-email-debug
>
> sudo docker build -t git-send-email-debug:latest .
>
> sudo docker run -it --name git-send-email-debug git-send-email-debug:latest
>
> ...
>
>
> Step 2) Make run.sh executable and start run.sh to create docker
> container shell. Inside the container's shell (will pop up
> automatically) please try this:
>
> git send-email --to="foo <foo@acme.com>,bar <bar@acme.com>"
> /email/test/*.patch
>
>
> Please let me know the results of the test case above and any other
> things you try that have interesting results.
>
>
> Thank you!
>
Whoops, somehow I missed the other responses on this thread until I
looked on the web archive version of this mailing list. I see that a
solution to "Use of uninitialized value $address" has already been proposed.
I suppose I may have mistook what issue was being reported. I had
originally understood the problem to be that hook related logic was
failing with correct email addresses, but it seems rather that we are
trying to fix an error that occurs when an email address that fails
extract_valid_address_or_die() is given. Feel free to ignore my last
email if that is all we are trying to solve.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [REGRESSION] uninitialized value $address in git send-email
2023-09-19 14:37 ` Michael Strawbridge
@ 2023-09-20 11:00 ` Bagas Sanjaya
2023-09-20 13:14 ` Michael Strawbridge
2023-09-20 15:43 ` Junio C Hamano
2023-09-20 15:36 ` Junio C Hamano
1 sibling, 2 replies; 12+ messages in thread
From: Bagas Sanjaya @ 2023-09-20 11:00 UTC (permalink / raw)
To: Michael Strawbridge, Junio C Hamano, Luben Tuikov,
Ævar Arnfjörð Bjarmason, Emily Shaffer,
Doug Anderson
Cc: Git Mailing List
[-- Attachment #1: Type: text/plain, Size: 1265 bytes --]
On Tue, Sep 19, 2023 at 10:37:36AM -0400, Michael Strawbridge wrote:
> I suppose I may have mistook what issue was being reported. I had
> originally understood the problem to be that hook related logic was
> failing with correct email addresses, but it seems rather that we are
> trying to fix an error that occurs when an email address that fails
> extract_valid_address_or_die() is given. Feel free to ignore my last
> email if that is all we are trying to solve.
>
Originally, I was intended to report regression on handling multiple
addresses passed in a single --to/--cc/--bcc option. Previously on Git v2.40,
git-send-email(1) accepts `--to="foo <foo@foo.com>,bar <bar@bar.com>"
as two separate --to addresses (with comma as separator). However, on
v2.41 and up, instead I got perl error as I reported in this thread.
Interestingly, that perl error can be reduced into one invalid addresses.
The same thing also happens to --cc and --bcc. I used aforementioned
trick when I was sending patches to LKML to save frin typing the same
option multiple times, each with different address.
If I need to send separate regression report for above use case,
please let me know.
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [REGRESSION] uninitialized value $address in git send-email
2023-09-20 11:00 ` Bagas Sanjaya
@ 2023-09-20 13:14 ` Michael Strawbridge
2023-09-20 15:43 ` Junio C Hamano
1 sibling, 0 replies; 12+ messages in thread
From: Michael Strawbridge @ 2023-09-20 13:14 UTC (permalink / raw)
To: Bagas Sanjaya, Junio C Hamano, Luben Tuikov,
Ævar Arnfjörð Bjarmason, Emily Shaffer,
Doug Anderson
Cc: Git Mailing List
On 2023-09-20 07:00, Bagas Sanjaya wrote:
> On Tue, Sep 19, 2023 at 10:37:36AM -0400, Michael Strawbridge wrote:
>> I suppose I may have mistook what issue was being reported. I had
>> originally understood the problem to be that hook related logic was
>> failing with correct email addresses, but it seems rather that we are
>> trying to fix an error that occurs when an email address that fails
>> extract_valid_address_or_die() is given. Feel free to ignore my last
>> email if that is all we are trying to solve.
>>
> Originally, I was intended to report regression on handling multiple
> addresses passed in a single --to/--cc/--bcc option. Previously on Git v2.40,
> git-send-email(1) accepts `--to="foo <foo@foo.com>,bar <bar@bar.com>"
> as two separate --to addresses (with comma as separator). However, on
> v2.41 and up, instead I got perl error as I reported in this thread.
> Interestingly, that perl error can be reduced into one invalid addresses.
> The same thing also happens to --cc and --bcc. I used aforementioned
> trick when I was sending patches to LKML to save frin typing the same
> option multiple times, each with different address.
>
> If I need to send separate regression report for above use case,
> please let me know.
>
I'm probably not the best person to answer whether you should file
another report. Junio would know better the processes of this mailing list.
However, I believe that if you are just trying to have the
"uninitialized value $address" error disappear then the above patch by
Taylor Blau should work great. Feel free to try it by editing your
local copy of git-send-email usually found here:
/usr/lib/git-core/git-send-email
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [REGRESSION] uninitialized value $address in git send-email
2023-09-19 14:37 ` Michael Strawbridge
2023-09-20 11:00 ` Bagas Sanjaya
@ 2023-09-20 15:36 ` Junio C Hamano
1 sibling, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2023-09-20 15:36 UTC (permalink / raw)
To: Michael Strawbridge
Cc: Bagas Sanjaya, Luben Tuikov,
Ævar Arnfjörð Bjarmason, Emily Shaffer,
Doug Anderson, Git Mailing List
Michael Strawbridge <michael.strawbridge@amd.com> writes:
> Whoops, somehow I missed the other responses on this thread until I
> looked on the web archive version of this mailing list. I see that a
> solution to "Use of uninitialized value $address" has already been proposed.
>
> I suppose I may have mistook what issue was being reported. I had
> originally understood the problem to be that hook related logic was
> failing with correct email addresses, but it seems rather that we are
> trying to fix an error that occurs when an email address that fails
> extract_valid_address_or_die() is given. Feel free to ignore my last
> email if that is all we are trying to solve.
I just had an impression that the original was complaining about the
command failing, and the patches addressed a side issue that the
error message that is given when the command fails uses an undefined
value. The report was not quite clear what Bagas considerd a
regression (e.g. did the command allow an invalid address like <pi@pi>
but now it complains?), though.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [REGRESSION] uninitialized value $address in git send-email
2023-09-20 11:00 ` Bagas Sanjaya
2023-09-20 13:14 ` Michael Strawbridge
@ 2023-09-20 15:43 ` Junio C Hamano
1 sibling, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2023-09-20 15:43 UTC (permalink / raw)
To: Bagas Sanjaya
Cc: Michael Strawbridge, Luben Tuikov,
Ævar Arnfjörð Bjarmason, Emily Shaffer,
Doug Anderson, Git Mailing List
Bagas Sanjaya <bagasdotme@gmail.com> writes:
> Originally, I was intended to report regression on handling multiple
> addresses passed in a single --to/--cc/--bcc option.
You refer to v2.40 and v2.41 in the message I am responding to, but
do you have a bisection? There seem to have been five topics around
send-email during that timeperiod.
$ git log --oneline --first-parent v2.40.0..v2.41.0 git-send-email.perl
b04671b638 Merge branch 'jc/send-email-pre-process-fix'
64477d20d7 Merge branch 'mc/send-email-header-cmd'
b6e9521956 Merge branch 'ms/send-email-feed-header-to-validate-hook'
c4c9d5586f Merge branch 'rj/send-email-validate-hook-count-messages'
647a2bb3ff Merge branch 'jc/spell-id-in-both-caps-in-message-id'
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-09-20 15:43 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-18 12:56 [REGRESSION] uninitialized value $address in git send-email Bagas Sanjaya
2023-09-18 16:35 ` [PATCH] git-send-email.perl: avoid printing undef when validating addresses Taylor Blau
2023-09-18 19:04 ` Junio C Hamano
2023-09-18 21:20 ` Jeff King
2023-09-18 20:26 ` [REGRESSION] uninitialized value $address in git send-email Michael Strawbridge
2023-09-19 4:44 ` Bagas Sanjaya
2023-09-19 14:04 ` Michael Strawbridge
2023-09-19 14:37 ` Michael Strawbridge
2023-09-20 11:00 ` Bagas Sanjaya
2023-09-20 13:14 ` Michael Strawbridge
2023-09-20 15:43 ` Junio C Hamano
2023-09-20 15:36 ` Junio C Hamano
Code repositories for project(s) associated with this public inbox
https://80x24.org/pub/scm/git/git.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).