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

Re: [PATCH 2/2] send-email: avoid creating more than one Term::ReadLine object

From
Taylor Blau <me@ttaylorr.com>
Date
Aug 8, 2023, 20:16 UTC
Message-ID
<ZNKihfNbEqJcCkXX@nand.local>
In-Reply-To
<20230808181531.GB2097200@coredump.intra.peff.net>
On Tue, Aug 08, 2023 at 02:15:31PM -0400, Jeff King wrote:
Show 7 quoted lines
> Every time git-send-email calls its ask() function to prompt the user,
> we call term(), which instantiates a new Term::ReadLine object. But in
> v1.46 of Term::ReadLine::Gnu (which provides the Term::ReadLine
> interface on some platforms), its constructor refuses to create a second
> instance[1]. So on systems with that version of the module, most
> git-send-email instances will fail (as we usually prompt for both "to"
> and "in-reply-to" unless the user provided them on the command line).

Nice one ;-). Everything you wrote here makes sense, as does initializing the Term::ReadLine object only once.

Show 6 quoted lines
> Note that the tests in t9001 detect this problem as-is, since the
> failure mode is for the program to die. But let's also beef up the
> "Prompting works" test to check that it correctly handles multiple
> inputs (if we had chosen to keep our FakeTerm hack in the previous
> commit, then the failure mode would be incorrectly ignoring prompts
> after the first).
Thanks for improving the test coverage while you're here.
Everything here LGTM.

Thanks, Taylor

Previous: Jeff KingNext: Jeff King
Message 3 of 5 in “fix git-send-email with recent versions of Term::ReadLine::Gnu”
  1. 0/2 fix git-send-email with recent versions of Term::ReadLine::GnuJeff King, Aug 8, 2023
  2. 2/2 send-email: avoid creating more than one Term::ReadLine objectJeff King, Aug 8, 2023
  3. Taylor BlauAug 8, 2023
  4. 1/2 send-email: drop FakeTerm hackJeff King, Aug 8, 2023
  5. Taylor BlauAug 8, 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.