Skip to content

Commit 48ded91

Browse files
committed
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>
1 parent 37869f4 commit 48ded91

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pretty.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ void get_commit_format(const char *arg, struct rev_info *rev)
2828
rev->commit_format = CMIT_FMT_DEFAULT;
2929
return;
3030
}
31-
if (*arg == '=')
32-
arg++;
3331
if (!prefixcmp(arg, "format:") || !prefixcmp(arg, "tformat:")) {
3432
const char *cp = strchr(arg, ':') + 1;
3533
free(user_format);

revision.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,11 +1197,16 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
11971197
revs->verbose_header = 1;
11981198
continue;
11991199
}
1200-
if (!prefixcmp(arg, "--pretty")) {
1200+
if (!strcmp(arg, "--pretty")) {
12011201
revs->verbose_header = 1;
12021202
get_commit_format(arg+8, revs);
12031203
continue;
12041204
}
1205+
if (!prefixcmp(arg, "--pretty=")) {
1206+
revs->verbose_header = 1;
1207+
get_commit_format(arg+9, revs);
1208+
continue;
1209+
}
12051210
if (!strcmp(arg, "--graph")) {
12061211
revs->topo_order = 1;
12071212
revs->rewrite_parents = 1;

0 commit comments

Comments
 (0)