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 <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Linus Torvalds committed
Nov 3, 2008 at 11:23 UTC
d467a525da28b28a0d8e16a42e121ab638fa7347
3 files changed
+4
-2
builtin-log.c
+1
-2
@@ -28,7 +28,6 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
28
struct rev_info *rev)
29
{
30
int i;
31
- int decorate = 0;
31
32
rev->abbrev = DEFAULT_ABBREV;
33
rev->commit_format = CMIT_FMT_DEFAULT;
@@ -55,7 +54,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
54
const char *arg = argv[i];
55
if (!strcmp(arg, "--decorate")) {
56
load_ref_decorations();
58
- decorate = 1;
57
+ rev->show_decorations = 1;
58
} else if (!strcmp(arg, "--source")) {
59
rev->show_source = 1;
60
} else
log-tree.c
+2
@@ -59,6 +59,8 @@ void show_decorations(struct rev_info *opt, struct commit *commit)
59
60
if (opt->show_source && commit->util)
61
printf(" %s", (char *) commit->util);
62
+ if (!opt->show_decorations)
63
+ return;
64
decoration = lookup_decoration(&name_decoration, &commit->object);
65
if (!decoration)
66
return;
revision.h
+1
@@ -54,6 +54,7 @@ struct rev_info {
54
rewrite_parents:1,
55
print_parents:1,
56
show_source:1,
57
+ show_decorations:1,
58
reverse:1,
59
reverse_output_stage:1,
60
cherry_pick:1,