summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-08-21 11:33:54 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-08-21 11:33:54 -0700
commit985d54008359db59a45462627884703aa7ce1ddb (patch)
tree5f82c34175cca377f117371b172c92bdfcb35226
parentMerge branch 'sb/maint-pull-rebase' into maint (diff)
parentshow: add space between multiple items (diff)
downloadtgif-985d54008359db59a45462627884703aa7ce1ddb.tar.xz
Merge branch 'jk/maint-show-tag' into maint
* jk/maint-show-tag: show: add space between multiple items show: suppress extra newline when showing annotated tag
-rw-r--r--builtin-log.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin-log.c b/builtin-log.c
index 0c2fa0ae2d..30358166e6 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -257,7 +257,7 @@ static void show_tagger(char *buf, int len, struct rev_info *rev)
pp_user_info("Tagger", rev->commit_format, &out, buf, rev->date_mode,
git_log_output_encoding ?
git_log_output_encoding: git_commit_encoding);
- printf("%s\n", out.buf);
+ printf("%s", out.buf);
strbuf_release(&out);
}
@@ -329,11 +329,14 @@ int cmd_show(int argc, const char **argv, const char *prefix)
case OBJ_TAG: {
struct tag *t = (struct tag *)o;
+ if (rev.shown_one)
+ putchar('\n');
printf("%stag %s%s\n",
diff_get_color_opt(&rev.diffopt, DIFF_COMMIT),
t->tag,
diff_get_color_opt(&rev.diffopt, DIFF_RESET));
ret = show_object(o->sha1, 1, &rev);
+ rev.shown_one = 1;
if (ret)
break;
o = parse_object(t->tagged->sha1);
@@ -345,12 +348,15 @@ int cmd_show(int argc, const char **argv, const char *prefix)
break;
}
case OBJ_TREE:
+ if (rev.shown_one)
+ putchar('\n');
printf("%stree %s%s\n\n",
diff_get_color_opt(&rev.diffopt, DIFF_COMMIT),
name,
diff_get_color_opt(&rev.diffopt, DIFF_RESET));
read_tree_recursive((struct tree *)o, "", 0, 0, NULL,
show_tree_object, NULL);
+ rev.shown_one = 1;
break;
case OBJ_COMMIT:
rev.pending.nr = rev.pending.alloc = 0;