]> git.ipfire.org Git - thirdparty/git.git/commit
print an error when remote helpers die during capabilities
authorJeff King <peff@peff.net>
Fri, 17 Jan 2014 20:36:21 +0000 (15:36 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 14 Sep 2024 16:35:53 +0000 (09:35 -0700)
commit6e7fac9bcab29e8d746b80f7e01631a461cdc785
tree7b3d9334282843e513aff3eba14ff953e76ec3df
parentdbecc617f75eea6ee5d05823a38b91223ff22b11
print an error when remote helpers die during capabilities

The transport-helper code generally relies on the
remote-helper to provide an informative message to the user
when it encounters an error. In the rare cases where the
helper does not do so, the output can be quite confusing.
E.g.:

  $ git clone https://example.com/foo.git
  Cloning into 'foo'...
  $ echo $?
  128
  $ ls foo
  /bin/ls: cannot access foo: No such file or directory

We tried to address this with 81d340d (transport-helper:
report errors properly, 2013-04-10).

But that makes the common case much more confusing. The
remote helper protocol's method for signaling normal errors
is to simply hang up. So when the helper does encounter a
routine error and prints something to stderr, the extra
error message is redundant and misleading. So we dropped it
again in 266f1fd (transport-helper: be quiet on read errors
from helpers, 2013-06-21).

This puts the uncommon case right back where it started. We
may be able to do a little better, though. It is common for
the helper to die during a "real" command, like fetching the
list of remote refs. It is not common for it to die during
the initial "capabilities" negotiation, right after we
start. Reporting failure here is likely to catch fundamental
problems that prevent the helper from running (and reporting
errors) at all. Anything after that is the responsibility of
the helper itself to report.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5801-remote-helpers.sh
transport-helper.c