From: Jeff King Date: Thu, 18 Aug 2011 05:04:56 +0000 (-0700) Subject: config: refactor get_colorbool function X-Git-Tag: v1.7.7-rc1~39^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c659f55b31bb928688afd4ddfd94f8bea978ff1a?hp=c659f55b31bb928688afd4ddfd94f8bea978ff1a config: refactor get_colorbool function For "git config --get-colorbool color.foo", we use a custom callback that looks not only for the key that the user gave us, but also for "diff.color" (for backwards compatibility) and "color.ui" (as a fallback). For the former, we use a custom variable to store the diff.color value. For the latter, though, we store it in the main "git_use_color_default" variable, turning on color.ui for any other parts of git that respect this value. In practice, this doesn't cause any bugs, because git-config runs without caring about git_use_color_default, and then exits. But it crosses module boundaries in an unusual and confusing way, and it makes refactoring color handling harder than it needs to be. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano ---