Skip to content

Commit

Permalink
Merge branch 'mk/color'
Browse files Browse the repository at this point in the history
* mk/color:
  Use color.ui variable in scripts too
  • Loading branch information
gitster committed Apr 20, 2008
2 parents 8876046 + 4d4f5ba commit dc46fa3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Documentation/git-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ See also <<FILES>>.
"auto". If `stdout-is-tty` is missing, then checks the standard
output of the command itself, and exits with status 0 if color
is to be used, or exits with status 1 otherwise.
When the color setting for `name` is undefined, the command uses
`color.ui` as fallback.

--get-color name default::

Expand Down
6 changes: 5 additions & 1 deletion builtin-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ static int git_get_colorbool_config(const char *var, const char *value)
get_diff_color_found =
git_config_colorbool(var, value, stdout_is_tty);
}
if (!strcmp(var, "color.ui")) {
git_use_color_default = git_config_colorbool(var, value, stdout_is_tty);
return 0;
}
return 0;
}

Expand Down Expand Up @@ -267,7 +271,7 @@ static int get_colorbool(int argc, const char **argv)
if (!strcmp(get_color_slot, "color.diff"))
get_colorbool_found = get_diff_color_found;
if (get_colorbool_found < 0)
get_colorbool_found = 0;
get_colorbool_found = git_use_color_default;
}

if (argc == 1) {
Expand Down

0 comments on commit dc46fa3

Please sign in to comment.