mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
Merge branch 'mm/color-auto-default'
Flip the default for color.ui to 'auto', which is what many tutorials recommend new users to do. * mm/color-auto-default: make color.ui default to 'auto' config: refactor management of color.ui's default value
This commit is contained in:
commit
73018c0f0b
|
@ -919,11 +919,12 @@ color.ui::
|
||||||
as `color.diff` and `color.grep` that control the use of color
|
as `color.diff` and `color.grep` that control the use of color
|
||||||
per command family. Its scope will expand as more commands learn
|
per command family. Its scope will expand as more commands learn
|
||||||
configuration to set a default for the `--color` option. Set it
|
configuration to set a default for the `--color` option. Set it
|
||||||
to `always` if you want all output not intended for machine
|
to `false` or `never` if you prefer Git commands not to use
|
||||||
consumption to use color, to `true` or `auto` if you want such
|
color unless enabled explicitly with some other configuration
|
||||||
output to use color when written to the terminal, or to `false` or
|
or the `--color` option. Set it to `always` if you want all
|
||||||
`never` if you prefer Git commands not to use color unless enabled
|
output not intended for machine consumption to use color, to
|
||||||
explicitly with some other configuration or the `--color` option.
|
`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.
|
||||||
|
|
||||||
column.ui::
|
column.ui::
|
||||||
Specify whether supported commands should output in columns.
|
Specify whether supported commands should output in columns.
|
||||||
|
|
|
@ -329,6 +329,7 @@ static int get_colorbool(int print)
|
||||||
{
|
{
|
||||||
get_colorbool_found = -1;
|
get_colorbool_found = -1;
|
||||||
get_diff_color_found = -1;
|
get_diff_color_found = -1;
|
||||||
|
get_color_ui_found = -1;
|
||||||
git_config_with_options(git_get_colorbool_config, NULL,
|
git_config_with_options(git_get_colorbool_config, NULL,
|
||||||
given_config_file, respect_includes);
|
given_config_file, respect_includes);
|
||||||
|
|
||||||
|
@ -339,6 +340,10 @@ static int get_colorbool(int print)
|
||||||
get_colorbool_found = get_color_ui_found;
|
get_colorbool_found = get_color_ui_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (get_colorbool_found < 0)
|
||||||
|
/* default value if none found in config */
|
||||||
|
get_colorbool_found = GIT_COLOR_AUTO;
|
||||||
|
|
||||||
get_colorbool_found = want_color(get_colorbool_found);
|
get_colorbool_found = want_color(get_colorbool_found);
|
||||||
|
|
||||||
if (print) {
|
if (print) {
|
||||||
|
|
Loading…
Reference in a new issue