From d467a525da28b28a0d8e16a42e121ab638fa7347 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 3 Nov 2008 11:23:57 -0800 Subject: [PATCH] Make '--decorate' set an explicit 'show_decorations' flag We will want to add decorations without necessarily showing them, so add an explicit revisions info flag as to whether we're showing decorations or not. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- builtin-log.c | 3 +-- log-tree.c | 2 ++ revision.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin-log.c b/builtin-log.c index 176cbce308..82ea07b1bd 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -28,7 +28,6 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix, struct rev_info *rev) { int i; - int decorate = 0; rev->abbrev = DEFAULT_ABBREV; rev->commit_format = CMIT_FMT_DEFAULT; @@ -55,7 +54,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix, const char *arg = argv[i]; if (!strcmp(arg, "--decorate")) { load_ref_decorations(); - decorate = 1; + rev->show_decorations = 1; } else if (!strcmp(arg, "--source")) { rev->show_source = 1; } else diff --git a/log-tree.c b/log-tree.c index cf7947b9c9..5444f0860b 100644 --- a/log-tree.c +++ b/log-tree.c @@ -59,6 +59,8 @@ void show_decorations(struct rev_info *opt, struct commit *commit) if (opt->show_source && commit->util) printf(" %s", (char *) commit->util); + if (!opt->show_decorations) + return; decoration = lookup_decoration(&name_decoration, &commit->object); if (!decoration) return; diff --git a/revision.h b/revision.h index 51a48630e8..0a1806a9e1 100644 --- a/revision.h +++ b/revision.h @@ -54,6 +54,7 @@ struct rev_info { rewrite_parents:1, print_parents:1, show_source:1, + show_decorations:1, reverse:1, reverse_output_stage:1, cherry_pick:1,