From: Junio C Hamano Date: Mon, 26 May 2008 03:19:30 +0000 (-0700) Subject: log --pretty: do not accept bogus "--prettyshort" X-Git-Tag: v1.5.6-rc1~51 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=48ded91674604c9756d53a7e657da0196795136f;p=git.git log --pretty: do not accept bogus "--prettyshort" ... nor bogus "format.pretty = '=short'". Both are syntax errors. Signed-off-by: Junio C Hamano --- diff --git a/pretty.c b/pretty.c index 687293224..8eb39e915 100644 --- a/pretty.c +++ b/pretty.c @@ -28,8 +28,6 @@ void get_commit_format(const char *arg, struct rev_info *rev) rev->commit_format = CMIT_FMT_DEFAULT; return; } - if (*arg == '=') - arg++; if (!prefixcmp(arg, "format:") || !prefixcmp(arg, "tformat:")) { const char *cp = strchr(arg, ':') + 1; free(user_format); diff --git a/revision.c b/revision.c index ac057e1e6..fc6675525 100644 --- a/revision.c +++ b/revision.c @@ -1197,11 +1197,16 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch revs->verbose_header = 1; continue; } - if (!prefixcmp(arg, "--pretty")) { + if (!strcmp(arg, "--pretty")) { revs->verbose_header = 1; get_commit_format(arg+8, revs); continue; } + if (!prefixcmp(arg, "--pretty=")) { + revs->verbose_header = 1; + get_commit_format(arg+9, revs); + continue; + } if (!strcmp(arg, "--graph")) { revs->topo_order = 1; revs->rewrite_parents = 1;