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

Re: Meaning of "fatal: protocol error: bad line length character"?

From
Junio C Hamano <junkio@cox.net>
Date
Jan 22, 2007, 19:45 UTC
Message-ID
<7vy7nusv52.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<17845.2402.105688.56648@lisa.zopyra.com>
Bill Lear <rael@zopyra.com> writes:
> He has an active update hook in his public repo, to send notices to
> his collaborators when his work is ready for them to pull, but we
> looked through it and don't see any printing to stdout.
Just a hunch.

Does the bash start-up sequence for the user emit something to stdout?

The attached patch on the local side (i.e. the one that pushes) dumps "garbage" you are getting on the line from the remote side, to help diagnosing the problem.

diff --git a/pkt-line.c b/pkt-line.c
index b4cb7e2..9bb1c90 100644
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -101,6 +101,16 @@ int packet_read_line(int fd, char *buffer, unsigned size)
 			len += c - 'A' + 10;
 			continue;
 		}
+		error("protocol error: bad line length character");
+		fprintf(stderr, "<<<<<\n%.*s", 4, linelen);
+		while (1) {
+			char buf[1024];
+			int cnt = xread(fd, buf, sizeof(buf));
+			if (cnt <= 0)
+				break;
+			fprintf(stderr, "%.*s", cnt, buf);
+		}
+		fprintf(stderr, "\n>>>>>\n");
 		die("protocol error: bad line length character");
 	}
 	if (!len)
Previous: Bill LearNext: Bill Lear
Message 11 of 17 in “Meaning of "fatal: protocol error: bad line length character"?”
  1. Bill LearJan 20, 2007
  2. Junio C HamanoJan 20, 2007
  3. Junio C HamanoJan 20, 2007
  4. Bill LearJan 20, 2007
  5. Jakub NarebskiJan 20, 2007
  6. Junio C HamanoJan 20, 2007
  7. Junio C HamanoJan 20, 2007
  8. Shawn O. PearceJan 20, 2007
  9. Junio C HamanoJan 22, 2007
  10. Bill LearJan 22, 2007
  11. Junio C HamanoJan 22, 2007
  12. Bill LearJan 22, 2007
  13. Bill LearJan 22, 2007
  14. Junio C HamanoJan 22, 2007
  15. Han-Wen NienhuysJan 23, 2007
  16. Junio C HamanoJan 23, 2007
  17. Han-Wen NienhuysJan 23, 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.