git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[REGRESSION] uninitialized value $address in git send-email

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
Sep 18, 2023, 12:56 UTC
Message-ID
<ZQhI5fMhDE82awpE@debian.me>
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
Next: Taylor Blau
Message 1 of 15 in “[REGRESSION] uninitialized value $address in git send-email”
  1. Bagas SanjayaSep 18, 2023
  2. git-send-email.perl: avoid printing undef when validating addressesTaylor Blau, Sep 18, 2023
  3. Junio C HamanoSep 18, 2023
  4. Jeff KingSep 18, 2023
  5. Michael StrawbridgeSep 18, 2023
  6. Bagas SanjayaSep 19, 2023
  7. Michael StrawbridgeSep 19, 2023
  8. Michael StrawbridgeSep 19, 2023
  9. Bagas SanjayaSep 20, 2023
  10. Michael StrawbridgeSep 20, 2023
  11. Junio C HamanoSep 20, 2023
  12. Bagas SanjayaSep 21, 2023
  13. Junio C HamanoSep 21, 2023
  14. Bagas SanjayaSep 22, 2023
  15. Junio C HamanoSep 20, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.