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

Re: [PATCH 8/6] receive-pack: Send internal errors over side-band #2

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Feb 10, 2010, 08:13 UTC
Message-ID
<4B726A8C.6010600@viscovery.net>
In-Reply-To
<4B725CB1.1080908@viscovery.net>
Johannes Sixt schrieb:
> Or did you replace only selected error() and warning() calls by rp_error()
> and rp_warning()?

Actually, you want to send only selected messages to the pusher. For example, these look like errors on the server side (right?) and should go to the site administrator:

Show 7 quoted lines
>  	if (!is_null_sha1(new_sha1) && !has_sha1_file(new_sha1)) {
> -		error("unpack should have generated %s, "
> -		      "but I can't find it!", sha1_to_hex(new_sha1));
> +		rp_error("unpack should have generated %s, "
> +			 "but I can't find it!", sha1_to_hex(new_sha1));
>  		return "bad pack";
>  	}
Show 8 quoted lines
>  		if (!old_object || !new_object ||
>  		    old_object->type != OBJ_COMMIT ||
>  		    new_object->type != OBJ_COMMIT) {
> -			error("bad sha1 objects for %s", name);
> +			rp_error("bad sha1 objects for %s", name);
>  			return "bad ref";
>  		}
>  		old_commit = (struct commit *)old_object;

In particular, your patch does not send errors produced by unpack-objects or index-pack to the pusher over the sideband, and this is the right thing to do.

-- Hannes
Previous: Junio C HamanoNext: Shawn O. Pearce
Message 5 of 10 in “t5401: Use a bare repository for the remote peer”
  1. 7/6 t5401: Use a bare repository for the remote peerShawn O. Pearce, Feb 10, 2010
  2. 8/6 receive-pack: Send internal errors over side-band #2Shawn O. Pearce, Feb 10, 2010
  3. Johannes SixtFeb 10, 2010
  4. Junio C HamanoFeb 10, 2010
  5. Johannes SixtFeb 10, 2010
  6. 8/6 receive-pack: Send internal errors over side-band #2Shawn O. Pearce, Feb 10, 2010
  7. Johannes SixtFeb 11, 2010
  8. Shawn O. PearceFeb 11, 2010
  9. Johannes SixtFeb 11, 2010
  10. Shawn O. PearceFeb 10, 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.