diff options
author | 2020-04-28 15:50:08 -0700 | |
---|---|---|
committer | 2020-04-28 15:50:08 -0700 | |
commit | d3fc8dc53a7ef9f33a5d9604b382e24408a9b7be (patch) | |
tree | 5f3a7e6ad3336d850083af8b24e38a2fffe089c9 /builtin | |
parent | Merge branch 'vd/range-diff-with-custom-pretty-format-fix' (diff) | |
parent | log: add log.excludeDecoration config option (diff) | |
download | tgif-d3fc8dc53a7ef9f33a5d9604b382e24408a9b7be.tar.xz |
Merge branch 'ds/log-exclude-decoration-config'
The "--decorate-refs" and "--decorate-refs-exclude" options "git
log" takes have learned a companion configuration variable
log.excludeDecoration that sits at the lowest priority in the
family.
* ds/log-exclude-decoration-config:
log: add log.excludeDecoration config option
log-tree: make ref_filter_match() a helper method
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/log.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c index 390b6ca2ce..bef7403d5e 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -166,9 +166,11 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, int quiet = 0, source = 0, mailmap; static struct line_opt_callback_data line_cb = {NULL, NULL, STRING_LIST_INIT_DUP}; static struct string_list decorate_refs_exclude = STRING_LIST_INIT_NODUP; + static struct string_list decorate_refs_exclude_config = STRING_LIST_INIT_NODUP; static struct string_list decorate_refs_include = STRING_LIST_INIT_NODUP; struct decoration_filter decoration_filter = {&decorate_refs_include, - &decorate_refs_exclude}; + &decorate_refs_exclude, + &decorate_refs_exclude_config}; static struct revision_sources revision_sources; const struct option builtin_log_options[] = { @@ -239,7 +241,19 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, } if (decoration_style) { + const struct string_list *config_exclude = + repo_config_get_value_multi(the_repository, + "log.excludeDecoration"); + + if (config_exclude) { + struct string_list_item *item; + for_each_string_list_item(item, config_exclude) + string_list_append(&decorate_refs_exclude_config, + item->string); + } + rev->show_decorations = 1; + load_ref_decorations(&decoration_filter, decoration_style); } |