git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] log --pretty: do not accept bogus "--prettyshort"

From
Junio C Hamano <gitster@pobox.com>
Date
May 26, 2008, 03:19 UTC
Message-ID
<7vy75xeoql.fsf@gitster.siamese.dyndns.org>
... 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
Next: Johannes Schindelin
Message 1 of 2 in “log --pretty: do not accept bogus "--prettyshort"”
  1. log --pretty: do not accept bogus "--prettyshort"Junio C Hamano, May 26, 2008
  2. Johannes SchindelinMay 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.