All of lore.kernel.org
 help / color / mirror / Atom feed
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: Tue, 06 Jul 2021 15:03:49 -0700	[thread overview]
Message-ID: <xmqqbl7fgkvu.fsf@gitster.g> (raw)
In-Reply-To: <20210706210317.706313-3-me@avishay.dev> (Avishay Matayev's message of "Wed, 7 Jul 2021 00:03:17 +0300")

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".

  reply	other threads:[~2021-07-06 22:03 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 [this message]
2021-07-09 14:49     ` Avishay Matayev
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

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

  git send-email \
    --in-reply-to=xmqqbl7fgkvu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.