diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-12-21 15:03:15 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-21 15:03:15 -0800 |
commit | 00cbaf93628282779504b470653ad239c4eca463 (patch) | |
tree | 0c6bf318a2e00ef74aa2cf56bb82db08e74bcc8a /builtin | |
parent | Merge branch 'en/rebase-x-wo-git-dir-env' (diff) | |
parent | log: load decorations with --simplify-by-decoration (diff) | |
download | tgif-00cbaf93628282779504b470653ad239c4eca463.tar.xz |
Merge branch 'jk/log-decorate-opts-with-implicit-decorate'
When "git log" implicitly enabled the "decoration" processing
without being explicitly asked with "--decorate" option, it failed
to read and honor the settings given by the "--decorate-refs"
option.
* jk/log-decorate-opts-with-implicit-decorate:
log: load decorations with --simplify-by-decoration
log: handle --decorate-refs with userformat "%d"
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/log.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/builtin/log.c b/builtin/log.c index f75d87e8d7..93ace0dde7 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -245,10 +245,24 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, rev->abbrev_commit = 0; } - if (rev->commit_format == CMIT_FMT_USERFORMAT && !w.decorate) - decoration_style = 0; + if (rev->commit_format == CMIT_FMT_USERFORMAT) { + if (!w.decorate) { + /* + * Disable decoration loading if the format will not + * show them anyway. + */ + decoration_style = 0; + } else if (!decoration_style) { + /* + * If we are going to show them, make sure we do load + * them here, but taking care not to override a + * specific style set by config or --decorate. + */ + decoration_style = DECORATE_SHORT_REFS; + } + } - if (decoration_style) { + if (decoration_style || rev->simplify_by_decoration) { const struct string_list *config_exclude = repo_config_get_value_multi(the_repository, "log.excludeDecoration"); @@ -260,7 +274,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, item->string); } - rev->show_decorations = 1; + if (decoration_style) + rev->show_decorations = 1; load_ref_decorations(&decoration_filter, decoration_style); } |