Re: General output formatting

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

 




On 2025-02-27 12:06, Junio C Hamano wrote:
Marc Branchaud <marcnarc@xxxxxxxxxxx> writes:

I wonder if isatty(1) is a good way to say "ah, we are not captured
in 'foo=$(git blah)' and not feeding somebody in 'git blah |
somebody', so we do not have to worry about being machine readable".
If that is a reliable way to tell that we could butcher our output
for the sake of keeping the terminal state sane, we then can always
do the C-quote escaping, or even information losing '?' redaction.

Modern practice seems to be moving towards explicit format options to
let code that's parsing output directly specify how it wants to see
the data.  Such options eliminate the need for isatty() heuristics and
other guesswork.

I am not opposed to an explicit "please avoid raw binary output" or
even "please make it even more machine-processable by formatting in
yaml" options.  What I was hinting at was what the default should be
for interactive use when the output goes directly to the eyes of
end-users, which is pretty much orthogonal.

Sorry, I read "if that is a reliable way to tell" as looking for reliability.

I have no opinion on exactly how to "butcher" the output for a terminal. I guess it depends on how well Git wants to support copy/paste of its output.

		M.





[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