git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH 4/4] color.ui config: add "isatty" setting

From
Junio C Hamano <gitster@pobox.com>
Date
May 30, 2018, 22:57 UTC
Message-ID
<xmqqmuwgda5k.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180530210641.19771-5-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 10 quoted lines
> A co-worker of mine who was using UNIX systems when dinosaurs roamed
> the earth was lamenting that kids these days were using tools like
> "git" that thought they knew better than isatty(3) when deciding
> whether or not something was a terminal, and the state of the
> documentation fixed earlier in this series certainly didn't help.
>
> So this setting is a small gift to all the UNIX graybeards out
> there. Now they can set color.ui=isatty and only emit fancy colors in
> situations when the gods of old intended, not whatever heuristic we've
> decided to set "auto" to.

Re-read the above again, and notice that you are *only* hinting that you consider difference between "auto" and "isatty" is important, and that your "isatty" is better, without telling what the difference is, let alone why you think "isatty" is better.

Show 7 quoted lines
>
> As noted here this is *currently* the same as setting color.ui=auto &
> color.pager=false, but I think it's good to explicitly have this
> setting for any future changes. The reason, as now noted in the
> documentation is that the "auto" setting may become even smarter in
> the future and learn even deeper heuristics for when to turn itself on
> even if isatty(3) were returning true.
Do you mean s/true/false/ in the last part?
> At that point the fans of plain isatty(3) will become even more upset
> at what we're doing, so let's give them a simple future-proof opt-out.

You still haven't explained why "auto" that does more than "isatty" is and will be irritating.

That's not a good way to sell a patch.

Also even "isatty" still needs to do more than isatty(1) call. The process that is trying to do color.ui=isatty may be talking to an outgoing pipe due to the use of "git -p cmd", by that time, it is too late to call isatty(1) and obtain the info the caller wishes to.

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 14 of 18 in “color.ui docs & add color.ui=isatty”
  1. 0/4 color.ui docs & add color.ui=isattyÆvar Arnfjörð Bjarmason, May 30, 2018
  2. 2/4 config doc: clarify "to a terminal" in color.uiÆvar Arnfjörð Bjarmason, May 30, 2018
  3. Jeff KingMay 31, 2018
  4. 3/4 color.ui config: don't die on unknown valuesÆvar Arnfjörð Bjarmason, May 30, 2018
  5. Stefan BellerMay 30, 2018
  6. Junio C HamanoMay 30, 2018
  7. Ævar Arnfjörð BjarmasonMay 31, 2018
  8. Jeff KingJun 1, 2018
  9. 1/4 config doc: move color.ui documentation to one placeÆvar Arnfjörð Bjarmason, May 30, 2018
  10. Jeff KingMay 31, 2018
  11. Ævar Arnfjörð BjarmasonMay 31, 2018
  12. Jeff KingJun 1, 2018
  13. 4/4 color.ui config: add "isatty" settingÆvar Arnfjörð Bjarmason, May 30, 2018
  14. Junio C HamanoMay 30, 2018
  15. Ævar Arnfjörð BjarmasonMay 31, 2018
  16. Jeff KingMay 31, 2018
  17. Ævar Arnfjörð BjarmasonMay 31, 2018
  18. Jeff KingJun 1, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.