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

Re: [PATCH] make color.ui default to 'auto'

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 15, 2013, 16:27 UTC
Message-ID
<vpqhai4fbsn.fsf@grenoble-inp.fr>
In-Reply-To
<7vy5bgckr4.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> Many tutorials tell the users to set color.ui=auto as a very first step.
>> These tutorials would benefit from skiping this step and starting the
>> real Git manipualtions earlier. Other beginners do not know about
>> color.ui=auto, and may not discover it by themselves, hence live with
>> black&white outputs while they may have prefered colors.
>>
>> A few people (e.g. color-blind) prefer having no colors, but they can
>> easily set color.ui=never for this (and googling "disable colors in git"
>> already tells them how to do so).
>
> The above two paragraphs do not make a good justification [*1*].
> The former can just as easily websearch for "enable colours in git"

I disagree: I do not know anyone who would be really harmed by colors (and such users would most likely have a terminal configured without colors I guess), so although I can imagine some people feeling less comfortable, disabling colors can be deferred to much later in the learning process.

When I teach Git to students (a relatively short tutorial), I currently ask them to type a ~/.gitconfig containing color.ui=auto before anything else. If this was the default, I would skip this completely from the beginner-oriented doc, and I would mention color.ui=never only to people complaining about colors. It's really about _skipping_ the color-related stuff from the newbie docs, not about reverting them.

Also, as my message points out, with "disabled by default", many people do not know that it is possible to have it, hence won't google for anything related to colors. There's no symmetry either here: with colors enabled by default, people will know that Git can use colors.

Show 16 quoted lines
>> diff --git a/Documentation/config.txt b/Documentation/config.txt
>> index 1009bfc..97550be 100644
>> --- a/Documentation/config.txt
>> +++ b/Documentation/config.txt
>> @@ -913,11 +913,12 @@ color.ui::
>>  	as `color.diff` and `color.grep` that control the use of color
>>  	per command family. Its scope will expand as more commands learn
>>  	configuration to set a default for the `--color` option.  Set it
>> +	to `false` or `never` if you prefer Git commands not to use
>> +	color unless enabled explicitly with some other configuration
>> +	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 2.0) if you
>> +	want such output to use color when written to the terminal.
>
> OK, so this is planned for 2.0?

We've lived without this for years, so I'd say it can wait untill Git 2.0. It may give a "Wow" effect to some users when upgrading ;-).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Junio C Hamano
Message 19 of 27 in “is this a bug of git-diff?”
  1. eric liouMay 15, 2013
  2. Antoine PelisseMay 15, 2013
  3. Antoine PelisseMay 15, 2013
  4. Matthieu MoyMay 15, 2013
  5. John KeepingMay 15, 2013
  6. Default for color.ui (was Re: is this a bug of git-diff?)Matthieu Moy, May 15, 2013
  7. Felipe ContrerasMay 15, 2013
  8. make color.ui default to 'auto'Matthieu Moy, May 15, 2013
  9. Johan HerlandMay 15, 2013
  10. make color.ui default to 'auto'Matthieu Moy, May 15, 2013
  11. Junio C HamanoMay 15, 2013
  12. Matthieu MoyMay 15, 2013
  13. 1/2 config: refactor management of color.ui's default valueMatthieu Moy, May 15, 2013
  14. 2/2 make color.ui default to 'auto'Matthieu Moy, May 15, 2013
  15. Junio C HamanoMay 15, 2013
  16. Stefano LattariniMay 15, 2013
  17. make color.ui default to 'auto'Matthieu Moy, May 15, 2013
  18. Junio C HamanoMay 15, 2013
  19. Matthieu MoyMay 15, 2013
  20. Junio C HamanoMay 15, 2013
  21. Matthieu MoyMay 15, 2013
  22. Junio C HamanoMay 15, 2013
  23. Matthieu MoyMay 15, 2013
  24. Junio C HamanoMay 15, 2013
  25. Felipe ContrerasMay 15, 2013
  26. John KeepingMay 15, 2013
  27. Mike HommeyMay 15, 2013

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.