* [PATCH] log --pretty: do not accept bogus "--prettyshort"
@ 2008-05-26 3:19 Junio C Hamano
2008-05-26 10:05 ` Johannes Schindelin
0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2008-05-26 3:19 UTC (permalink / raw)
To: Eric Wong; +Cc: git
... nor bogus "format.pretty = '=short'". Both are syntax errors.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
* This lazy parsing was introduced by 6cdfd17 (commit: allow --pretty=
args to be abbreviated, 2006-05-14), more than a year ago...
pretty.c | 2 --
revision.c | 7 ++++++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/pretty.c b/pretty.c
index 6872932..8eb39e9 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 ac057e1..fc66755 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;
--
1.5.5.1.467.g9bd81
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] log --pretty: do not accept bogus "--prettyshort"
2008-05-26 3:19 [PATCH] log --pretty: do not accept bogus "--prettyshort" Junio C Hamano
@ 2008-05-26 10:05 ` Johannes Schindelin
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Schindelin @ 2008-05-26 10:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Eric Wong, git
Hi,
On Sun, 25 May 2008, Junio C Hamano wrote:
> diff --git a/revision.c b/revision.c
> index ac057e1..fc66755 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);
Does "args+8" really make sense, still? Okay, it is the same as "", but
the latter would not make me go "Hum?!".
Ciao,
Dscho
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-26 10:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-26 3:19 [PATCH] log --pretty: do not accept bogus "--prettyshort" Junio C Hamano
2008-05-26 10:05 ` Johannes Schindelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).