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

Re: (Mosty harmless) protocol error when pushing

From
Jeff King <peff@peff.net>
Date
May 25, 2010, 07:28 UTC
Message-ID
<20100525072824.GA19612@coredump.intra.peff.net>
In-Reply-To
<AANLkTikbFaNhiDngY7Cgk0Ce0YhmNBGIpXtn7abjXnPR@mail.gmail.com>
On Tue, May 25, 2010 at 08:51:34AM +0200, Björn Gustavsson wrote:
> I am not sure whether this has been reported before.
> I follow this mailing list, but I don't read all emails in
> detail, so I could have missed a bug report or a fix
> for the problem.

I haven't seen it before, and I do read most of the emails (OK, I skip some of the boring ones. :) ).

Show 11 quoted lines
> Counting objects: 270, done.
> Delta compression using up to 8 threads.
> Compressing objects: 100% (71/71), done.
> Writing objects: 100% (184/184), 151.33 KiB, done.
> Total 184 (delta 157), reused 134 (delta 113)
> Auto packing the repository for optimum performance.
> fatal: protocol error: bad line length character: Remo
> error: error in sideband demultiplexer
> To git@github.com:bjorng/otp.git
>  + 7651a63...874192d bg/nif_error -> bg/nif_error (forced update)
> error: failed to push some refs to 'git@github.com:bjorng/otp.git'

I wasn't able to reproduce here, but I wonder if this would help (more or less a cut-and-paste from the hook-running code in receive-pack):

diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index bb34757..c0a6a3b 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -843,7 +843,20 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
 			const char *argv_gc_auto[] = {
 				"gc", "--auto", "--quiet", NULL,
 			};
-			run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
+			struct child_process proc;
+
+			memset(&proc, 0, sizeof(proc));
+			proc.no_stdin = 1;
+			proc.stdout_to_stderr = 1;
+			proc.err = use_sideband ? -1 : 0;
+			proc.git_cmd = 1;
+			proc.argv = argv_gc_auto;
+
+			if (!start_command(&proc)) {
+				if (use_sideband)
+					copy_to_sideband(proc.err, -1, NULL);
+				finish_command(&proc);
+			}
 		}
 		if (auto_update_server_info)
 			update_server_info(0);

Unfortunately I can't actually test it. :)

-Peff
Previous: Björn GustavssonNext: Björn Gustavsson
Message 2 of 5 in “(Mosty harmless) protocol error when pushing”
  1. Björn GustavssonMay 25, 2010
  2. Jeff KingMay 25, 2010
  3. Björn GustavssonMay 26, 2010
  4. Ilari LiusvaaraMay 27, 2010
  5. Jeff KingMay 27, 2010

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.