transport-helper: mention helper name when it dies
When we try to read from a remote-helper and get EOF or an error, we print a message indicating that the helper died. However, users may not know that a remote helper was in use (e.g., when using git-over-http), or even what a remote helper is. Let's print the name of the helper (e.g., "git-remote-https"); this makes it more obvious what the program is for, and provides a useful token for reporting bugs or searching for more information (e.g., in manpages). Signed-off-by: Jeff King <peff@peff.net> Acked-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
81d340d40a
commit
c096955c5b
|
@ -182,7 +182,7 @@ test_expect_success 'proper failure checks for pushing' '
|
||||||
cd local &&
|
cd local &&
|
||||||
test_must_fail git push --all 2> error &&
|
test_must_fail git push --all 2> error &&
|
||||||
cat error &&
|
cat error &&
|
||||||
grep -q "Reading from remote helper failed" error
|
grep -q "Reading from helper .git-remote-testgit. failed" error
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ static void sendline(struct helper_data *helper, struct strbuf *buffer)
|
||||||
die_errno("Full write to remote helper failed");
|
die_errno("Full write to remote helper failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int recvline_fh(FILE *helper, struct strbuf *buffer)
|
static int recvline_fh(FILE *helper, struct strbuf *buffer, const char *name)
|
||||||
{
|
{
|
||||||
strbuf_reset(buffer);
|
strbuf_reset(buffer);
|
||||||
if (debug)
|
if (debug)
|
||||||
|
@ -54,7 +54,7 @@ static int recvline_fh(FILE *helper, struct strbuf *buffer)
|
||||||
if (strbuf_getline(buffer, helper, '\n') == EOF) {
|
if (strbuf_getline(buffer, helper, '\n') == EOF) {
|
||||||
if (debug)
|
if (debug)
|
||||||
fprintf(stderr, "Debug: Remote helper quit.\n");
|
fprintf(stderr, "Debug: Remote helper quit.\n");
|
||||||
die("Reading from remote helper failed");
|
die("Reading from helper 'git-remote-%s' failed", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
|
@ -64,7 +64,7 @@ static int recvline_fh(FILE *helper, struct strbuf *buffer)
|
||||||
|
|
||||||
static int recvline(struct helper_data *helper, struct strbuf *buffer)
|
static int recvline(struct helper_data *helper, struct strbuf *buffer)
|
||||||
{
|
{
|
||||||
return recvline_fh(helper->out, buffer);
|
return recvline_fh(helper->out, buffer, helper->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xchgline(struct helper_data *helper, struct strbuf *buffer)
|
static void xchgline(struct helper_data *helper, struct strbuf *buffer)
|
||||||
|
@ -536,7 +536,7 @@ static int process_connect_service(struct transport *transport,
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
sendline(data, &cmdbuf);
|
sendline(data, &cmdbuf);
|
||||||
recvline_fh(input, &cmdbuf);
|
recvline_fh(input, &cmdbuf, name);
|
||||||
if (!strcmp(cmdbuf.buf, "")) {
|
if (!strcmp(cmdbuf.buf, "")) {
|
||||||
data->no_disconnect_req = 1;
|
data->no_disconnect_req = 1;
|
||||||
if (debug)
|
if (debug)
|
||||||
|
|
Loading…
Reference in New Issue