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

Re: [PATCH] drop unnecessary copying in credential_ask_one

From
Jeff King <peff@peff.net>
Date
Jan 7, 2014, 20:02 UTC
Message-ID
<20140107200221.GB21812@sigill.intra.peff.net>
In-Reply-To
<xmqqlhyrd1bz.fsf@gitster.dls.corp.google.com>
On Tue, Jan 07, 2014 at 11:44:00AM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> > test-terminal only handles stdout and stderr streams as fake terminals.
> > We could pretty easily add stdin for input, as it uses fork() to work
> > asynchronously.  But the credential code does not actually read from
> > stdin. It opens and reads from /dev/tty explicitly. So I think we'd have
> > to actually fake setting up a controlling terminal. And that means magic
> > with setsid() and ioctl(TIOCSCTTY), which in turn sounds like a
> > portability headache.
> 
> I wonder if "expect" has already solved that for us.

I would not be surprised if it did. Though it introduces its own portability issues, since we cannot depend on having it. But it is probably enough to just

  test_lazy_prereq EXPECT 'expect --version'

or something. I dunno. I have never used expect, do not have it installed, and am not excited about introducing a new tool dependency. But if you want to explore it, be my guest.

-Peff
Previous: Junio C Hamano
Message 7 of 7 in “drop unnecessary copying in credential_ask_one”
  1. drop unnecessary copying in credential_ask_oneTay Ray Chuan, Jan 2, 2014
  2. Jeff KingJan 2, 2014
  3. Jeff KingJan 2, 2014
  4. Junio C HamanoJan 2, 2014
  5. Jeff KingJan 7, 2014
  6. Junio C HamanoJan 7, 2014
  7. Jeff KingJan 7, 2014

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.