git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Avishay Matayev <me@avishay.dev>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, code@tpope.net
Subject: Re: [PATCH 2/3] Allow isatty to be overriden with GIT_FORCE_TTY
Date: Fri, 9 Jul 2021 17:49:32 +0300	[thread overview]
Message-ID: <CAJ-0Osy2RLiZmi9m=W=rpK6Bh5uXk-psO-BTb18a8COrsQANUw@mail.gmail.com> (raw)
In-Reply-To: <xmqqbl7fgkvu.fsf@gitster.g>

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?

  reply	other threads:[~2021-07-09 14:49 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 [this message]
2021-07-09 17:21       ` Junio C Hamano
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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CAJ-0Osy2RLiZmi9m=W=rpK6Bh5uXk-psO-BTb18a8COrsQANUw@mail.gmail.com' \
    --to=me@avishay.dev \
    --cc=code@tpope.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).