summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorMichal Vitecek <fuf@mageo.cz>2007-09-25 14:38:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-09-26 07:40:47 (GMT)
commit55246aac6717e86c14f31391ac903ed810d1a9a0 (patch)
treed2526538770e575669d0d0ac648f45328e0e42de /log-tree.c
parent5166810b1e16b22e342f2181a3535e70c6e7a119 (diff)
downloadgit-55246aac6717e86c14f31391ac903ed810d1a9a0.zip
git-55246aac6717e86c14f31391ac903ed810d1a9a0.tar.gz
git-55246aac6717e86c14f31391ac903ed810d1a9a0.tar.bz2
Don't use "<unknown>" for placeholders and suppress printing of empty user formats.
This changes the interporate() to replace entries with NULL values by the empty string, and uses it to interpolate missing fields in custom format output used in git-log and friends. It is most useful to avoid <unknown> output from %b format for a commit log message that lack any body text. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/log-tree.c b/log-tree.c
index a642371..79e3dee 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -298,7 +298,8 @@ void show_log(struct rev_info *opt, const char *sep)
if (opt->show_log_size)
printf("log size %i\n", len);
- printf("%s%s%s", msgbuf, extra, sep);
+ if (*msgbuf)
+ printf("%s%s%s", msgbuf, extra, sep);
free(msgbuf);
}