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

Re: [PATCH 1/2] send-email: refactor and ensure prompting doesn't loop forever

From
Jay Soffian <jaysoffian@gmail.com>
Date
Mar 30, 2009, 15:45 UTC
Message-ID
<76718490903300845x14897599jc73f50a16b21605d@mail.gmail.com>
In-Reply-To
<vpqwsa7gjlh.fsf@bauges.imag.fr>
On Mon, Mar 30, 2009 at 10:40 AM, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
Show 6 quoted lines
> Jay Soffian <jaysoffian@gmail.com> writes:
>> Seriously though, I am unable to reproduce the messages you are
>> getting from Term::ReadLine, and I tried really hard.
>
> Anyway, as I said, the warnings do not harm. They just appear messy in
> my log files, but it's really a matter of polishing the UI.

Okay, well, I figured out how to work the polish. Term::ReadLine is attempting to use /dev/tty for input/output, which is closed. And because send-email enables warnings, its attempt to do so emits the messages you are seeing. Can you confirm that this patch squelches the warnings?

diff --git a/git-send-email.perl b/git-send-email.perl
index f0405c8..1b17728 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -612,6 +612,8 @@ sub ask {
        my $default = $arg{default};
        my $resp;
        my $i = 0;
+       return undef unless defined fileno($term->IN) and
+                           defined fileno($term->OUT);
        while ($i++ < 10) {
                $resp = $term->readline($prompt);
                if (!defined $resp) { # EOF


Thanks,

j.
Previous: Matthieu MoyNext: Jay Soffian
Message 14 of 17 in “send-email: refactor and ensure prompting doesn't loop forever”
  1. 1/2 send-email: refactor and ensure prompting doesn't loop foreverJay Soffian, Mar 29, 2009
  2. 2/2 send-email: add tests for refactored promptingJay Soffian, Mar 29, 2009
  3. Björn SteinbrinkMar 31, 2009
  4. Jay SoffianMar 31, 2009
  5. Jay SoffianMar 31, 2009
  6. Björn SteinbrinkMar 31, 2009
  7. Jay SoffianMar 31, 2009
  8. Jay SoffianMar 29, 2009
  9. Junio C HamanoMar 30, 2009
  10. Matthieu MoyMar 30, 2009
  11. Jay SoffianMar 30, 2009
  12. Jay SoffianMar 30, 2009
  13. Matthieu MoyMar 30, 2009
  14. Jay SoffianMar 30, 2009
  15. Jay SoffianMar 30, 2009
  16. Matthieu MoyMar 31, 2009
  17. Jay SoffianMar 31, 2009

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.