log --pretty: do not accept bogus "--prettyshort"
... nor bogus "format.pretty = '=short'". Both are syntax errors. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
May 25, 2008 at 20:19 UTC
48ded91674604c9756d53a7e657da0196795136f
2 files changed
+6
-3
pretty.c
-2
@@ -28,8 +28,6 @@ void get_commit_format(const char *arg, struct rev_info *rev)
28
rev->commit_format = CMIT_FMT_DEFAULT;
29
return;
30
}
31
- if (*arg == '=')
32
- arg++;
31
if (!prefixcmp(arg, "format:") || !prefixcmp(arg, "tformat:")) {
32
const char *cp = strchr(arg, ':') + 1;
33
free(user_format);
revision.c
+6
-1
@@ -1197,11 +1197,16 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
1197
revs->verbose_header = 1;
1198
continue;
1199
}
1200
- if (!prefixcmp(arg, "--pretty")) {
1200
+ if (!strcmp(arg, "--pretty")) {
1201
revs->verbose_header = 1;
1202
get_commit_format(arg+8, revs);
1203
continue;
1204
}
1205
+ if (!prefixcmp(arg, "--pretty=")) {
1206
+ revs->verbose_header = 1;
1207
+ get_commit_format(arg+9, revs);
1208
+ continue;
1209
+ }
1210
if (!strcmp(arg, "--graph")) {
1211
revs->topo_order = 1;
1212
revs->rewrite_parents = 1;