Skip to content

Commit fb11de9

Browse files
committed
Merge branch 'ah/log-decorate-default-to-auto' into maint
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
2 parents 6c940eb + c74271a commit fb11de9

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

builtin/log.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ static void init_log_defaults(void)
110110
{
111111
init_grep_defaults();
112112
init_diff_ui_defaults();
113+
114+
decoration_style = auto_decoration_style();
113115
}
114116

115117
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)
410412
if (decoration_style < 0)
411413
decoration_style = 0; /* maybe warn? */
412414
return 0;
413-
} else {
414-
decoration_style = auto_decoration_style();
415415
}
416416
if (!strcmp(var, "log.showroot")) {
417417
default_show_root = git_config_bool(var, value);

t/t4202-log.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,18 @@ test_expect_success 'log.decorate configuration' '
577577
578578
'
579579

580+
test_expect_success 'log.decorate config parsing' '
581+
git log --oneline --decorate=full >expect.full &&
582+
git log --oneline --decorate=short >expect.short &&
583+
584+
test_config log.decorate full &&
585+
test_config log.mailmap true &&
586+
git log --oneline >actual &&
587+
test_cmp expect.full actual &&
588+
git log --oneline --decorate=short >actual &&
589+
test_cmp expect.short actual
590+
'
591+
580592
test_expect_success TTY 'log output on a TTY' '
581593
git log --oneline --decorate >expect.short &&
582594

0 commit comments

Comments
 (0)