diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-12-14 00:28:54 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-14 00:28:54 +0300 |
commit | 6c3daa23461333c508c41faa532c6fb749cd0db0 (patch) | |
tree | 0d480e7fae2e4d975e317b22f99d668bac436fbe /builtin | |
parent | 721cc4314cb593e799213ad5f926a1e9fc5779b0 (diff) | |
parent | 65516f586b69307f977cd67cc45513a296cabc25 (diff) |
Merge branch 'ra/decorate-limit-refs'
The tagnames "git log --decorate" uses to annotate the commits can
now be limited to subset of available refs with the two additional
options, --decorate-refs[-exclude]=<pattern>.
* ra/decorate-limit-refs:
log: add option to choose which refs to decorate
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/log.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c index 6c1fa896ad..14fdf39165 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -142,11 +142,19 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, struct userformat_want w; int quiet = 0, source = 0, mailmap = 0; 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_include = STRING_LIST_INIT_NODUP; + struct decoration_filter decoration_filter = {&decorate_refs_include, + &decorate_refs_exclude}; const struct option builtin_log_options[] = { OPT__QUIET(&quiet, N_("suppress diff output")), OPT_BOOL(0, "source", &source, N_("show source")), OPT_BOOL(0, "use-mailmap", &mailmap, N_("Use mail map file")), + OPT_STRING_LIST(0, "decorate-refs", &decorate_refs_include, + N_("pattern"), N_("only decorate refs that match <pattern>")), + OPT_STRING_LIST(0, "decorate-refs-exclude", &decorate_refs_exclude, + N_("pattern"), N_("do not decorate refs that match <pattern>")), { OPTION_CALLBACK, 0, "decorate", NULL, NULL, N_("decorate options"), PARSE_OPT_OPTARG, decorate_callback}, OPT_CALLBACK('L', NULL, &line_cb, "n,m:file", @@ -205,7 +213,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, if (decoration_style) { rev->show_decorations = 1; - load_ref_decorations(decoration_style); + load_ref_decorations(&decoration_filter, decoration_style); } if (rev->line_level_traverse) |