Skip to content

Commit

Permalink
log --pretty: do not accept bogus "--prettyshort"
Browse files Browse the repository at this point in the history
... nor bogus "format.pretty = '=short'".  Both are syntax errors.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed May 26, 2008
1 parent 37869f4 commit 48ded91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 0 additions & 2 deletions pretty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 6 additions & 1 deletion revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 48ded91

Please sign in to comment.