Skip to content

Commit

Permalink
transport-helper: be quiet on read errors from helpers
Browse files Browse the repository at this point in the history
Prior to commit 81d340d, we did not print any error message
if a remote transport helper died unexpectedly. If a helper
did not print any error message (e.g., because it crashed),
the user could be left confused. That commit tried to
rectify the situation by printing a note that the helper
exited unexpectedly.

However, this makes a much more common case worse: when a
helper does die with a useful message, we print the extra
"Reading from 'git-remote-foo failed" message. This can also
end up confusing users, as they may not even know what
remote helpers are (e.g., the fact that http support comes
through git-remote-https is purely an implementation detail
that most users do not know or care about).

Since we do not have a good way of knowing whether the
helper printed a useful error, and since the common failure
mode is for it to do so, let's default to remaining quiet.
Debuggers can dig further by setting GIT_TRANSPORT_HELPER_DEBUG.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jun 21, 2013
1 parent 21ff915 commit 266f1fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions t/t5801-remote-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ test_expect_success 'proper failure checks for pushing' '
(GIT_REMOTE_TESTGIT_FAILURE=1 &&
export GIT_REMOTE_TESTGIT_FAILURE &&
cd local &&
test_must_fail git push --all 2> error &&
cat error &&
grep -q "Reading from helper .git-remote-testgit. failed" error
test_must_fail git push --all
)
'

Expand Down
2 changes: 1 addition & 1 deletion transport-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static int recvline_fh(FILE *helper, struct strbuf *buffer, const char *name)
if (strbuf_getline(buffer, helper, '\n') == EOF) {
if (debug)
fprintf(stderr, "Debug: Remote helper quit.\n");
die("Reading from helper 'git-remote-%s' failed", name);
exit(128);
}

if (debug)
Expand Down

0 comments on commit 266f1fd

Please sign in to comment.