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

Re: [PATCH] git-svn: avoid warning on undef readline()

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Apr 7, 2018, 19:20 UTC
Message-ID
<20180407192022.GD9954@genre.crustytoothpaste.net>
In-Reply-To
<20180406131514.740-1-avarab@gmail.com>
On Fri, Apr 06, 2018 at 01:15:14PM +0000, Ævar Arnfjörð Bjarmason wrote:
Show 15 quoted lines
> Change code in Git.pm that sometimes calls chomp() on undef to only do
> so the value is defined.
> 
> This code has been chomping undef values ever since it was added in
> b26098fc2f ("git-svn: reduce scope of input record separator change",
> 2016-10-14), but started warning due to the introduction of "use
> warnings" to Git.pm in my f0e19cb7ce ("Git.pm: add the "use warnings"
> pragma", 2018-02-25) released with 2.17.0.
> 
> Since this function will return undef in those cases it's still
> possible that the code using it will warn if it does a chomp of its
> own, as the code added in b26098fc2f ("git-svn: reduce scope of input
> record separator change", 2016-10-14) might do, but since git-svn has
> "use warnings" already that's clearly not a codepath that's going to
> warn.

Thanks for this patch. I ran into this earlier this week (with git svn fetch) and had intended to send a patch, but you clearly got to it before I did.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Junio C Hamano
Message 11 of 11 in “git 2.17.0: uninitialized value $rec in scalar chomp at ...Git.pm line 557”
  1. Joseph MingroneApr 6, 2018
  2. Johannes SchindelinApr 6, 2018
  3. Joseph MingroneApr 6, 2018
  4. git-svn: avoid warning on undef readline()Ævar Arnfjörð Bjarmason, Apr 6, 2018
  5. Johannes SchindelinApr 6, 2018
  6. Eric WongApr 6, 2018
  7. Ævar Arnfjörð BjarmasonApr 6, 2018
  8. Eric WongApr 6, 2018
  9. Ævar Arnfjörð BjarmasonApr 6, 2018
  10. Junio C HamanoApr 9, 2018
  11. brian m. carlsonApr 7, 2018

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.