From: Junio C Hamano <gitster@pobox.com>
To: Avishay Matayev <me@avishay.dev>
Cc: git@vger.kernel.org, code@tpope.net
Subject: Re: [PATCH 2/3] Allow isatty to be overriden with GIT_FORCE_TTY
Date: Fri, 09 Jul 2021 10:21:21 -0700 [thread overview]
Message-ID: <xmqqo8bb769a.fsf@gitster.g> (raw)
In-Reply-To: <CAJ-0Osy2RLiZmi9m=W=rpK6Bh5uXk-psO-BTb18a8COrsQANUw@mail.gmail.com> (Avishay Matayev's message of "Fri, 9 Jul 2021 17:49:32 +0300")
Avishay Matayev <me@avishay.dev> writes:
> On Wed, 7 Jul 2021 at 01:03, Junio C Hamano <gitster@pobox.com> wrote:
>>
>> Avishay Matayev <me@avishay.dev> writes:
>>
>> > There are several behaviors where git will not attempt to do an action if a
>> > tty is not present, for example - `git_pager` (pager.c) will instruct git
>> > to not use the GIT_PAGER environment variable if stdout is not a pty.
>>
>> In general, I am negative on this approach, even though I agree that
>> the issue you are trying to solve is worth solving. "Force pretend
>> that we are talking to a TTY" exposes too much of the internal
>> logic in the implementation to the end users.
>>
>> Often we use isatty() as an approximation for "are we being
>> interactive?", and I wouldn't have as much problem as I have with
>> the "FORCE_TTY" to an approach to give users a knob to tell us "do
>> not use your logic to guess---I am telling you that we are
>> interactive, so behave as such".
> I'm not sure that I understand your view on this patch.
> `git_isatty()` does exactly that, it gives the users that knob, doesn't it?
>
> If you don't find the approach in this patch good enough, what exactly
> do you suggest?
Start with not tying this feature with the word "TTY", probably.
next prev parent reply other threads:[~2021-07-09 17:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-06 21:03 [PATCH 0/3] Override isatty with GIT_FORCE_TTY Avishay Matayev
2021-07-06 21:03 ` [PATCH 1/3] Change isatty's parameter to a *_FILENO define Avishay Matayev
2021-07-06 21:59 ` Junio C Hamano
2021-07-09 14:41 ` Avishay Matayev
2021-07-06 21:03 ` [PATCH 2/3] Allow isatty to be overriden with GIT_FORCE_TTY Avishay Matayev
2021-07-06 22:03 ` Junio C Hamano
2021-07-09 14:49 ` Avishay Matayev
2021-07-09 17:21 ` Junio C Hamano [this message]
2021-07-09 17:24 ` Avishay Matayev
2021-07-09 18:41 ` Junio C Hamano
2021-07-09 19:56 ` Avishay Matayev
2021-07-06 21:03 ` [PATCH 3/3] Add tests for GIT_FORCE_TTY Avishay Matayev
2021-07-30 12:04 ` [PATCH 0/3] Override isatty with GIT_FORCE_TTY Avishay Matayev
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=xmqqo8bb769a.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=code@tpope.net \
--cc=git@vger.kernel.org \
--cc=me@avishay.dev \
/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;
as well as URLs for NNTP newsgroup(s).