Merge branch 'ah/log-decorate-default-to-auto' into maint
authorJunio C Hamano <gitster@pobox.com>
Sun, 4 Jun 2017 01:20:57 +0000 (10:20 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 4 Jun 2017 01:20:57 +0000 (10:20 +0900)
Setting "log.decorate=false" in the configuration file did not take
effect in v2.13, which has been corrected.

* ah/log-decorate-default-to-auto:
builtin/log: honor log.decorate

builtin/log.c
t/t4202-log.sh
index b3b10cc1edba2f6d77fdf4b12c328a7968fb5499..ec3258368ca96eb9120c64994b8132a6e00b5d24 100644 (file)
@@ -110,6 +110,8 @@ static void init_log_defaults(void)
 {
        init_grep_defaults();
        init_diff_ui_defaults();
+
+       decoration_style = auto_decoration_style();
 }
 
 static void cmd_log_init_defaults(struct rev_info *rev)
@@ -410,8 +412,6 @@ static int git_log_config(const char *var, const char *value, void *cb)
                if (decoration_style < 0)
                        decoration_style = 0; /* maybe warn? */
                return 0;
-       } else {
-               decoration_style = auto_decoration_style();
        }
        if (!strcmp(var, "log.showroot")) {
                default_show_root = git_config_bool(var, value);
index f577990716011cfbc9a1b605aa5f23fe0d660c56..1c7d6729c699dc8c8784d19659551df24530bd05 100755 (executable)
@@ -577,6 +577,18 @@ test_expect_success 'log.decorate configuration' '
 
 '
 
+test_expect_success 'log.decorate config parsing' '
+       git log --oneline --decorate=full >expect.full &&
+       git log --oneline --decorate=short >expect.short &&
+
+       test_config log.decorate full &&
+       test_config log.mailmap true &&
+       git log --oneline >actual &&
+       test_cmp expect.full actual &&
+       git log --oneline --decorate=short >actual &&
+       test_cmp expect.short actual
+'
+
 test_expect_success TTY 'log output on a TTY' '
        git log --oneline --decorate >expect.short &&