From 3d6675958f0423d99164927c1d941f38ef6308e7 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 31 Jan 2012 15:20:25 +0100 Subject: [PATCH] accepts color.ui boolean values To configure color, git accepts {auto,never,always} as well as the usual boolean values {true,false}. .gitconfig examples: Always enable colors: [color] ui = true Never use colors: [color] ui = false Change-Id: I2c309ed8ef1c8b50d0ed283e813dbf64c57d7671 --- AUTHORS | 1 + git-review | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 176aeddf..f9f336e4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,3 +3,4 @@ James E. Blair Saggi Mizrahi Kiall Mac Innes Roan Kattouw +Antoine Musso diff --git a/git-review b/git-review index 5a95fe89..cb86e1d1 100755 --- a/git-review +++ b/git-review @@ -388,9 +388,11 @@ def assert_one_change(remote, branch, yes, have_hook): branch_name = get_branch_name(branch) has_color = check_color_support() if has_color: - color = git_config_get_value("color", "ui") - if color == "": + color = git_config_get_value("color", "ui").lower() + if(color == "" or color == "true"): color = "auto" + elif color == "false": + color = "never" elif color == "auto": # Python is not a tty, we have to force colors color = "always"