git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] send-email: avoid creating more than one Term::ReadLine object
Date: Tue, 8 Aug 2023 16:16:05 -0400	[thread overview]
Message-ID: <ZNKihfNbEqJcCkXX@nand.local> (raw)
In-Reply-To: <20230808181531.GB2097200@coredump.intra.peff.net>

On Tue, Aug 08, 2023 at 02:15:31PM -0400, Jeff King wrote:
> 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.

> 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

      reply	other threads:[~2023-08-08 20:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 18:09 [PATCH 0/2] fix git-send-email with recent versions of Term::ReadLine::Gnu Jeff King
2023-08-08 18:14 ` [PATCH 1/2] send-email: drop FakeTerm hack Jeff King
2023-08-08 20:13   ` Taylor Blau
2023-08-08 18:15 ` [PATCH 2/2] send-email: avoid creating more than one Term::ReadLine object Jeff King
2023-08-08 20:16   ` Taylor Blau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZNKihfNbEqJcCkXX@nand.local \
    --to=me@ttaylorr.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).