git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>,
	"Stefan Beller" <sbeller@google.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 2/4] config doc: clarify "to a terminal" in color.ui
Date: Wed, 30 May 2018 21:06:39 +0000	[thread overview]
Message-ID: <20180530210641.19771-3-avarab@gmail.com> (raw)
In-Reply-To: <20180530210641.19771-1-avarab@gmail.com>

Change the documentation added when color.ui=auto was made the default
in 4c7f1819b3 ("make color.ui default to 'auto'", 2013-06-10) to
describe "auto" as kicking in when writing to the terminal or a pager,
not just to the terminal.

I had someone ask me why it was that git was writing colors with
color.ui=auto in situations where isatty(3) would return 0. The
existing documentation about that would have been true before
85fb65ed6e (""git -p cmd" to page anywhere", 2006-06-06), but since
then "auto" has always used a heuristic that isn't quite what isatty()
would return, rather it checks if we're connected to a TTY or if we're
about to emit to a pager, trusting that the pager can handle color
output.

Instead we have the color.pager variable introduced in
aa086eb813 ("pager: config variable pager.color", 2006-07-30) to
explicitly disable color output to the pager. Let's change the
documentation to reflect this.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Documentation/config.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 44735dd88e..4767363519 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1288,7 +1288,9 @@ color.ui::
 	or the `--color` option. Set it to `always` if you want all
 	output not intended for machine consumption to use color, to
 	`true` or `auto` (this is the default since Git 1.8.4) if you
-	want such output to use color when written to the terminal.
+	want such output to use color when written to the terminal (as
+	determined by a call to `isatty(3)`) or to a pager (unless
+	`color.pager` is set to false).
 
 column.ui::
 	Specify whether supported commands should output in columns.
-- 
2.17.0.290.gded63e768a


  parent reply	other threads:[~2018-05-30 21:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 21:06 [PATCH 0/4] color.ui docs & add color.ui=isatty Ævar Arnfjörð Bjarmason
2018-05-30 21:06 ` [PATCH 1/4] config doc: move color.ui documentation to one place Ævar Arnfjörð Bjarmason
2018-05-31  5:25   ` Jeff King
2018-05-31  7:09     ` Ævar Arnfjörð Bjarmason
2018-06-01  5:31       ` Jeff King
2018-05-30 21:06 ` Ævar Arnfjörð Bjarmason [this message]
2018-05-31  5:27   ` [PATCH 2/4] config doc: clarify "to a terminal" in color.ui Jeff King
2018-05-30 21:06 ` [RFC PATCH 3/4] color.ui config: don't die on unknown values Ævar Arnfjörð Bjarmason
2018-05-30 22:32   ` Stefan Beller
2018-05-30 23:05   ` Junio C Hamano
2018-05-31  7:17     ` Ævar Arnfjörð Bjarmason
2018-06-01  5:53       ` Jeff King
2018-05-30 21:06 ` [RFC PATCH 4/4] color.ui config: add "isatty" setting Ævar Arnfjörð Bjarmason
2018-05-30 22:57   ` Junio C Hamano
2018-05-31  7:07     ` Ævar Arnfjörð Bjarmason
2018-05-31  5:38   ` Jeff King
2018-05-31  7:01     ` Ævar Arnfjörð Bjarmason
2018-06-01  5:30       ` Jeff King

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=20180530210641.19771-3-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=peff@peff.net \
    --cc=sbeller@google.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).