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

[PATCH] Fix "--pretty=format:" encoding item

From
Jeff King <peff@peff.net>
Date
Mar 28, 2007, 21:09 UTC
Message-ID
<20070328210905.GB7898@coredump.intra.peff.net>

It printed the header "encoding " instead of just showing the encoding, as all other items do.

This now passes t6006.
Signed-off-by: Jeff King <peff@peff.net>
---
 commit.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/commit.c b/commit.c
index 9ac533c..a4f2e74 100644
--- a/commit.c
+++ b/commit.c
@@ -888,7 +888,8 @@ static long format_commit_message(const struct commit *commit,
 			fill_person(table + ICOMMITTER_NAME,
 					msg + i + 10, eol - i - 10);
 		else if (!prefixcmp(msg + i, "encoding "))
-			table[IENCODING].value = xstrndup(msg + i, eol - i);
+			table[IENCODING].value =
+				xstrndup(msg + i + 9, eol - i - 9);
 		i = eol;
 	}
 	if (msg[i])
-- 
1.5.1.rc2.636.gff57
Message 1 of 1 in “Fix "--pretty=format:" encoding item”
  1. Fix "--pretty=format:" encoding itemJeff King, Mar 28, 2007

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.