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