Skip to content

Commit

Permalink
Make '--decorate' set an explicit 'show_decorations' flag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed Nov 4, 2008
1 parent 3a5e860 commit d467a52
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions builtin-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions log-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions revision.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d467a52

Please sign in to comment.