Re: [PATCH v1 1/8] compat/terminal: let prompt accept input from pipe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Firmin Martin <firminmartin24@xxxxxxxxx> writes:

> Currently, git_prompt ignores input coming from anywhere other than
> terminal (pipe, redirection etc.) meaning that standard prompt
> auto-answering methods would have no effect:
>
>         echo 'Y' | git ...
>         yes 'Y' | git ...
>         git ... <input.txt
>
> It also prevents git subcommands using git_prompt to be tested using
> such methods.

For testing, wouldn't lib-terminal.sh be usable for your purpose?
If not, what is the reason why it is insufficient?  Can we fix that
instead?

Allowing prompter to read from pipe has a big downside in the
production code: you cannot pipe data into our command, and let it
ask interactive questions from the end user by opening /dev/tty.


> This patch fixes this issue by considering standard input when !isatty(0).
> It also rearranges the control flow to close input and output file handlers.

So this "fix" is probably very unwelcome, especially if done
unconditionally.

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux