All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: git@vger.kernel.org
Subject: [PATCH] log --pretty: do not accept bogus "--prettyshort"
Date: Sun, 25 May 2008 20:19:30 -0700	[thread overview]
Message-ID: <7vy75xeoql.fsf@gitster.siamese.dyndns.org> (raw)

... 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

             reply	other threads:[~2008-05-26  3:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-26  3:19 Junio C Hamano [this message]
2008-05-26 10:05 ` [PATCH] log --pretty: do not accept bogus "--prettyshort" Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vy75xeoql.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.