public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Marc Branchaud <marcnarc@xiplink.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
	 Jeff King <peff@peff.net>,
	 Yaakov Smith <Yaakov.Smith@wisetechglobal.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: General output formatting
Date: Thu, 27 Feb 2025 09:06:28 -0800	[thread overview]
Message-ID: <xmqq34fz9v1n.fsf@gitster.g> (raw)
In-Reply-To: <3a58720f-a572-4e3a-bed1-cc7e8f46e3c7@xiplink.com> (Marc Branchaud's message of "Thu, 27 Feb 2025 09:06:52 -0500")

Marc Branchaud <marcnarc@xiplink.com> 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.

Thanks.

  reply	other threads:[~2025-02-27 17:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 23:44 \b character escapes in CLI usage Yaakov Smith
2025-02-26  7:38 ` Jeff King
2025-02-26  8:09   ` Jeff King
2025-02-26 16:02     ` Junio C Hamano
2025-02-26 16:38     ` Kyle Lippincott
2025-02-26 22:06       ` Jeff King
2025-02-26 15:59   ` Junio C Hamano
2025-02-26 23:36   ` brian m. carlson
2025-02-26 23:55     ` Junio C Hamano
2025-02-27  0:03     ` Junio C Hamano
2025-02-27 14:06       ` General output formatting (was: Re: \b character escapes in CLI usage) Marc Branchaud
2025-02-27 17:06         ` Junio C Hamano [this message]
2025-02-27 17:14           ` General output formatting Marc Branchaud
2025-02-27 18:40             ` Junio C Hamano
2025-02-27 16:26     ` \b character escapes in CLI usage Phillip Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq34fz9v1n.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Yaakov.Smith@wisetechglobal.com \
    --cc=git@vger.kernel.org \
    --cc=marcnarc@xiplink.com \
    --cc=peff@peff.net \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox