pretty: treat "--format=" as an empty userformat
Until now, we treated "--pretty=" or "--format=" as "give me the default format". This was not planned nor documented, but only what happened to work due to our parsing of "--pretty" (which should give the default format). Let's instead let these be an actual empty userformat. Otherwise one must write out the annoyingly long "--pretty=tformat:" to get the same behavior. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ae18165fbb
commit
c75e7ad28a
4
pretty.c
4
pretty.c
@ -146,7 +146,7 @@ void get_commit_format(const char *arg, struct rev_info *rev)
|
|||||||
struct cmt_fmt_map *commit_format;
|
struct cmt_fmt_map *commit_format;
|
||||||
|
|
||||||
rev->use_terminator = 0;
|
rev->use_terminator = 0;
|
||||||
if (!arg || !*arg) {
|
if (!arg) {
|
||||||
rev->commit_format = CMIT_FMT_DEFAULT;
|
rev->commit_format = CMIT_FMT_DEFAULT;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ void get_commit_format(const char *arg, struct rev_info *rev)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strchr(arg, '%')) {
|
if (!*arg || strchr(arg, '%')) {
|
||||||
save_user_format(rev, arg, 1);
|
save_user_format(rev, arg, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user