| author | Jeff King <peff@peff.net> | |
| Thu, 18 Aug 2011 05:05:35 +0000 (22:05 -0700) | ||
| committer | Junio C Hamano <gitster@pobox.com> | |
| Fri, 19 Aug 2011 22:51:38 +0000 (15:51 -0700) | ||
| commit | c9bfb953489e559d513c1627150aa16f8d42d6c5 | |
| tree | 2c12de73bcf6ecdb5f2c28aff6cbb3aba91f182a | tree | snapshot |
| parent | 3e1dd17a8958cc5fe47a7ca01c9da8f6fae9cb0b | commit | diff |
want_color: automatically fallback to color.ui
All of the "do we want color" flags default to -1 to
indicate that we don't have any color configured. This value
is handled in one of two ways:
1. In porcelain, we check early on whether the value is
still -1 after reading the config, and set it to the
value of color.ui (which defaults to 0).
2. In plumbing, it stays untouched as -1, and want_color
defaults it to off.
This works fine, but means that every porcelain has to check
and reassign its color flag. Now that want_color gives us a
place to put this check in a single spot, we can do that,
simplifying the calling code.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
All of the "do we want color" flags default to -1 to
indicate that we don't have any color configured. This value
is handled in one of two ways:
1. In porcelain, we check early on whether the value is
still -1 after reading the config, and set it to the
value of color.ui (which defaults to 0).
2. In plumbing, it stays untouched as -1, and want_color
defaults it to off.
This works fine, but means that every porcelain has to check
and reassign its color flag. Now that want_color gives us a
place to put this check in a single spot, we can do that,
simplifying the calling code.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| builtin/branch.c | diff | blob | history | |
| builtin/commit.c | diff | blob | history | |
| builtin/diff.c | diff | blob | history | |
| builtin/grep.c | diff | blob | history | |
| builtin/log.c | diff | blob | history | |
| builtin/merge.c | diff | blob | history | |
| builtin/show-branch.c | diff | blob | history | |
| color.c | diff | blob | history | |
| color.h | diff | blob | history |