From: Johannes Sixt <j6t@kdbg.org>
To: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Cc: git@vger.kernel.org
Subject: [PATCH 4/4] Improve error message when a transport helper was not found
Date: Sun, 10 Jan 2010 14:18:39 +0100 [thread overview]
Message-ID: <201001101418.39321.j6t@kdbg.org> (raw)
In-Reply-To: <201001101404.22258.j6t@kdbg.org>
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Perviously, the error message was:
git: 'remote-foo' is not a git-command. See 'git --help'.
By not treating the transport helper as a git command, a more suitable
error is reported:
fatal: Unable to find remote helper for 'foo'
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
While I agree mostly with the implementation of your patch, the justification
was completely off, and I think it was because you did not notice that the
parent process died from SIGPIPE. When patches 1-3/4 are applied, the
parent does not die from SIGPIPE anymore, and the issue is now only minor
(an unsuitable error message instead of no error message). Therefore,
I rewrote the commit message to tone it down.
-- Hannes
transport-helper.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index 6ece0d9..d1bc3af 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -102,6 +102,7 @@ static struct child_process *get_helper(struct transport *transport)
int refspec_nr = 0;
int refspec_alloc = 0;
int duped;
+ int code;
if (data->helper)
return data->helper;
@@ -111,13 +112,18 @@ static struct child_process *get_helper(struct transport *transport)
helper->out = -1;
helper->err = 0;
helper->argv = xcalloc(4, sizeof(*helper->argv));
- strbuf_addf(&buf, "remote-%s", data->name);
+ strbuf_addf(&buf, "git-remote-%s", data->name);
helper->argv[0] = strbuf_detach(&buf, NULL);
helper->argv[1] = transport->remote->name;
helper->argv[2] = remove_ext_force(transport->url);
- helper->git_cmd = 1;
- if (start_command(helper))
- die("Unable to run helper: git %s", helper->argv[0]);
+ helper->git_cmd = 0;
+ helper->silent_exec_failure = 1;
+ code = start_command(helper);
+ if (code < 0 && errno == ENOENT)
+ die("Unable to find remote helper for '%s'", data->name);
+ else
+ exit(code);
+
data->helper = helper;
data->no_disconnect_req = 0;
--
1.6.6.115.gd1ab3
next prev parent reply other threads:[~2010-01-10 13:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-09 13:45 [RFC PATCH v2 0/2] Imporove remote helper exec failure reporting Ilari Liusvaara
2010-01-09 13:45 ` [RFC PATCH v2 1/2] Report exec errors from run-command Ilari Liusvaara
2010-01-10 13:04 ` [PATCH 0/4] Detect exec errors in start_command early Johannes Sixt
2010-01-10 13:07 ` [PATCH 1/4] start_command: report child process setup errors to the parent's stderr Johannes Sixt
2010-01-10 13:08 ` [PATCH 2/4] run-command: move wait_or_whine earlier Johannes Sixt
2010-01-10 13:11 ` [PATCH 3/4] start_command: detect execvp failures early Johannes Sixt
2010-01-14 21:31 ` Junio C Hamano
2010-01-14 21:53 ` Johannes Sixt
2010-01-14 22:40 ` Junio C Hamano
2010-01-10 13:18 ` Johannes Sixt [this message]
2010-01-09 13:45 ` [RFC PATCH v2 2/2] Improve transport helper exec failure reporting Ilari Liusvaara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201001101418.39321.j6t@kdbg.org \
--to=j6t@kdbg.org \
--cc=git@vger.kernel.org \
--cc=ilari.liusvaara@elisanet.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).