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:

committed by
Junio C Hamano

parent
5166810b1e
commit
55246aac67
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user