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

Re: [PATCH 2/3] receive-pack: send pack-processing stderr over sideband

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 21, 2012, 16:49 UTC
Message-ID
<7v7grn8gnv.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120921053455.GB9863@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 29 quoted lines
> Receive-pack invokes either unpack-objects or index-pack to
> handle the incoming pack. However, we do not redirect the
> stderr of the sub-processes at all, so it is never seen by
> the client. From the initial thread adding sideband support,
> which is here:
>
>   http://thread.gmane.org/gmane.comp.version-control.git/139471
>
> it is clear that some messages are specifically kept off the
> sideband (with the assumption that they are of interest only
> to an administrator, not the client). The stderr of the
> subprocesses is mentioned in the thread, but it's unclear if
> they are included in that group, or were simply forgotten.
>
> However, there are a few good reasons to show them to the
> client:
>
>   1. In many cases, they are directly about the incoming
>      packfile (e.g., fsck warnings with --strict, corruption
>      in the packfile, etc). Without these messages, the
>      client just gets "unpacker error" with no extra useful
>      diagnosis.
>
>   2. No matter what the cause, we are probably better off
>      showing the errors to the client. If the client and the
>      server admin are not the same entity, it is probably
>      much easier for the client to cut-and-paste the errors
>      they see than for the admin to try to dig them out of a
>      log and correlate them with a particular session.

I agree with the "probably" above (and also with points 1 and 3), but it at the same time feel a bit iffy. The server side would lose log entries to check when the operator observes higher error rate and starts suspecting something recently broke, and the lost clue cannot be recovered without contacting the pushers, no?

Show 12 quoted lines
>   3. Users of the ssh transport typically already see these
>      stderr messages, as the remote's stderr is copied
>      literally by ssh. This brings other transports (http,
>      and push-over-git if you are crazy enough to enable it)
>      more in line with ssh. As a bonus for ssh users,
>      because the messages are now fed through the sideband
>      and printed by the local git, they will have "remote:"
>      prepended and be properly interleaved with any local
>      output to stderr.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
Will queue; thanks.
Previous: Jeff KingNext: Jeff King
Message 4 of 8 in “nicer receive-pack errors over http”
  1. 0/3 nicer receive-pack errors over httpJeff King, Sep 21, 2012
  2. 1/3 receive-pack: redirect unpack-objects stdout to /dev/nullJeff King, Sep 21, 2012
  3. 2/3 receive-pack: send pack-processing stderr over sidebandJeff King, Sep 21, 2012
  4. Junio C HamanoSep 21, 2012
  5. Jeff KingSep 21, 2012
  6. Junio C HamanoSep 21, 2012
  7. Jeff KingSep 21, 2012
  8. 3/3 receive-pack: drop "n/a" on unpacker errorsJeff King, Sep 21, 2012

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.