Re: [PATCH v1 1/8] compat/terminal: let prompt accept input from pipe
- From
Jeff King <peff@peff.net>
- Date
- May 11, 2021, 06:10 UTC
- Message-ID
- <YJof0/Eq18QnLumV@coredump.intra.peff.net>
- In-Reply-To
- <xmqq1raeos7x.fsf@gitster.g>
On Tue, May 11, 2021 at 12:38:10PM +0900, Junio C Hamano wrote:
Show 11 quoted lines
> >> I actually inspired myself from the two occurrences of git_prompt in > >> builtin/bisect--helper.c introduced in 09535f056b (bisect--helper: > >> reimplement `bisect_autostart` shell function in C, 2020-09-24). > >> Not sure if they should also be converted to a simple fgets. > > > > Yes, I think they should be switched. > > OK, that is because in the context of a "bisect" session, we won't > be feeding any real data from its standard input, unlike "git am" > that may well be eating a patch stream from its standard input > stream. If so, makes sense.
Yes, though even in "git am", we forbid using interactive mode with patches on stdin (and did so even when we were reading from the tty; presumably the rule dates back to when it was a shell script and was using stdin).
-Peff