From: Jeff King Date: Thu, 04 Nov 2021 09:53:58 GMT Subject: Re: [PATCH 2/2] prompt.c: add and use a GIT_TEST_TERMINAL_PROMPT=true Message-ID: In-Reply-To: On Wed, Nov 03, 2021 at 10:42:14AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > Basically, I think I just disagree with this paragraph entirely. Moving > > to stdin in the commits you referenced was done to help testing, but I > > also think it's just a more flexible direction overall. > > It is OK, and it is more convenient for writing test scripts, to > take interactive input from the standard input stream, if the > command does not use the standard input for other purposes. > > "git am -i but "git am -i mbox" is an easy workaround, for example. > > Commands that are designed to be used in the downstream of a pipe > (e.g. "git rev-list ... | git pack-objects") cannot easily use such > a workaround, so they may still need to open and interact with > /dev/tty if they want to do an interactive input, though [*]. True. The most Unix-y thing there would be to provide an option for reading interactive input from an arbitrary descriptor. That gives the most flexibility, though it's probably a bit arcane for most folks to do: git foo | git bar --interactive-from=3 3