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

[PATCH] Fix truncated usage messages

From
Björn Gustavsson <bgustavsson@gmail.com>
Date
Nov 22, 2009, 21:19 UTC
Message-ID
<4B09AAF9.5000102@gmail.com>

The usage messages for some commands (such as 'git diff-tree') are truncated because they don't fit in a fixed buffer of 1024 bytes.

It would be tempting to eliminate the buffer and the problem once and for all by doing the output in three steps, but doing so could (according to commit d048a96e) increase the likelyhood of messing up the display.

So we just increase the size of the buffer.
Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
---
 usage.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/usage.c b/usage.c
index e307e01..79856a2 100644
--- a/usage.c
+++ b/usage.c
@@ -7,7 +7,7 @@
 
 static void report(const char *prefix, const char *err, va_list params)
 {
-	char msg[1024];
+	char msg[4096];
 	vsnprintf(msg, sizeof(msg), err, params);
 	fprintf(stderr, "%s%s\n", prefix, msg);
 }
-- 
1.6.5.3.298.g39add
Message 1 of 1 in “Fix truncated usage messages”
  1. Fix truncated usage messagesBjörn Gustavsson, Nov 22, 2009

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.