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

[updated patch v3 2/2] Improve transport helper exec failure reporting

From
ILIlari Liusvaara <ilari.liusvaara@elisanet.fi>
Date
Dec 31, 2009, 18:26 UTC
Message-ID
<1262284003-1417-3-git-send-email-ilari.liusvaara@elisanet.fi>
In-Reply-To
<1262284003-1417-1-git-send-email-ilari.liusvaara@elisanet.fi>

Previously transport-helper exec failure error reporting was pretty much useless as it didn't report errors from execve, only from pipe and fork. Now that run-command passes errno from exec, use the improved support to actually print useful errors if execution fails.

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
---
 transport-helper.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index 5078c71..73da339 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -31,13 +31,19 @@ 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] = 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;
+	if (start_command(helper)) {
+		if (errno == ENOENT)
+			die("Unable to find remote helper for \"%s\"",
+				data->name);
+		else
+			die_errno("Unable to run helper %s", helper->argv[0]);
+	}
 	data->helper = helper;
 
 	write_str_in_full(helper->in, "capabilities\n");
-- 
1.6.6.3.gaa2e1
Previous: Junio C HamanoNext: Johannes Sixt
Message 5 of 6 in “Imporve remote helpers exec failure reporting”
  1. 0/2 Imporve remote helpers exec failure reportingIlari Liusvaara, Dec 31, 2009
  2. 1/2 Report exec errors from run-commandIlari Liusvaara, Dec 31, 2009
  3. Johannes SixtDec 31, 2009
  4. Junio C HamanoJan 5, 2010
  5. 2/2 Improve transport helper exec failure reportingIlari Liusvaara, Dec 31, 2009
  6. Johannes SixtDec 31, 2009

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.