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

Do not barf on too long action description

From
Junio C Hamano <junkio@cox.net>
Date
Apr 28, 2007, 07:15 UTC
Message-ID
<7v3b2lklzv.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<20070428002638.GF18276@pasky.or.cz>

Reflog message is primarily about easier identification, and leaving truncated entry is much better than dying.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 builtin-fetch--tool.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index 3145c01..1b04881 100644
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c
@@ -42,9 +42,7 @@ static int update_ref(const char *action,
 
 	if (!rla)
 		rla = "(reflog update)";
-	len = snprintf(msg, sizeof(msg), "%s: %s", rla, action);
-	if (sizeof(msg) <= len)
-		die("insanely long action");
+	snprintf(msg, sizeof(msg), "%s: %s", rla, action);
 	lock = lock_any_ref_for_update(refname, oldval);
 	if (!lock)
 		return 1;
Message 1 of 1 in “Do not barf on too long action description”
  1. Junio C HamanoApr 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.