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

Re: [Updated PATCH 2/2] Improve transport helper exec failure reporting

From
Johannes Sixt <j6t@kdbg.org>
Date
Dec 31, 2009, 15:44 UTC
Message-ID
<4B3CC6E5.7090404@kdbg.org>
In-Reply-To
<1262170338-11574-3-git-send-email-ilari.liusvaara@elisanet.fi>
Ilari Liusvaara schrieb:
Show 17 quoted lines
> @@ -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;
> +	if (start_command(helper)) {
> +		if (errno == ENOENT)
> +			die("Unable to find remote helper for \"%s\"",
> +				data->name);

You should set helper->silent_exec_failure = 1 when you give your own error message for the ENOENT case.

BTW, which error message do you see without your change in this case? You only say "pretty much useless", but do not give an example.

> +		else
> +			die("Unable to run helper %s: %s", helper->argv[0],
> +				strerror(errno));

You shouldn't write an error message here because start_command has already reported the error.

-- Hannes
Previous: Ilari LiusvaaraNext: Ilari Liusvaara
Message 8 of 13 in “Improve remote helpers exec error reporting”
  1. 0/2 Improve remote helpers exec error reportingIlari Liusvaara, Dec 30, 2009
  2. 1/2 Report exec errors from run-commandIlari Liusvaara, Dec 30, 2009
  3. Erik Faye-LundDec 30, 2009
  4. TarmiganDec 31, 2009
  5. Ilari LiusvaaraDec 31, 2009
  6. TarmiganDec 31, 2009
  7. 2/2 Improve transport helper exec failure reportingIlari Liusvaara, Dec 30, 2009
  8. Johannes SixtDec 31, 2009
  9. Ilari LiusvaaraDec 31, 2009
  10. Johannes SixtDec 31, 2009
  11. Ilari LiusvaaraDec 31, 2009
  12. Johannes SixtDec 31, 2009
  13. Johannes SixtJan 1, 2010

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.