From: Jeff King Date: Tue, 29 Jul 2014 17:54:46 +0000 (-0400) Subject: pretty: treat "--format=" as an empty userformat X-Git-Tag: v2.1.1~12^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c75e7ad28a34081ca6e7e53c0551fa6c99b208b0;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/pretty.c b/pretty.c index 3a1da6fd32..f97a762515 100644 --- a/pretty.c +++ b/pretty.c @@ -146,7 +146,7 @@ void get_commit_format(const char *arg, struct rev_info *rev) struct cmt_fmt_map *commit_format; rev->use_terminator = 0; - if (!arg || !*arg) { + if (!arg) { rev->commit_format = CMIT_FMT_DEFAULT; return; } @@ -155,7 +155,7 @@ void get_commit_format(const char *arg, struct rev_info *rev) return; } - if (strchr(arg, '%')) { + if (!*arg || strchr(arg, '%')) { save_user_format(rev, arg, 1); return; }