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>
This commit is contained in:
Michal Vitecek
2007-09-25 16:38:46 +02:00
committed by Junio C Hamano
parent 5166810b1e
commit 55246aac67
6 changed files with 11 additions and 16 deletions

View File

@ -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);
}