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

Re: [PATCH] builtin-apply: Show a more descriptive error on failure when opening a patch

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 14, 2008, 14:03 UTC
Message-ID
<alpine.DEB.1.00.0804141502590.28504@racer>
In-Reply-To
<1208112991-21598-1-git-send-email-albertito@gmail.com>
Hi,
On Sun, 13 Apr 2008, Alberto Bertogli wrote:
Show 14 quoted lines
> diff --git a/builtin-apply.c b/builtin-apply.c
> index abe73a0..d80b231 100644
> --- a/builtin-apply.c
> +++ b/builtin-apply.c
> @@ -3120,8 +3120,11 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
>  			arg = prefix_filename(prefix, prefix_length, arg);
>  
>  		fd = open(arg, O_RDONLY);
> -		if (fd < 0)
> -			usage(apply_usage);
> +		if (fd < 0) {
> +			perror("Error opening patch");
> +			return 1;
> +		}

Would "return error("...: '%s'", arg);" not be much more appropriate and consistent with the resto of the source code?

Ciao, Dscho

Previous: Junio C Hamano
Message 7 of 7 in “builtin-apply: Show a more descriptive error on failure when opening a patch”
  1. builtin-apply: Show a more descriptive error on failure when opening a patchAlberto Bertogli, Apr 13, 2008
  2. Junio C HamanoApr 13, 2008
  3. builtin-apply: Show a more descriptive error on failure when opening a patchAlberto Bertogli, Apr 14, 2008
  4. Johannes SchindelinApr 14, 2008
  5. builtin-apply: Show a more descriptive error on failure when opening a patchAlberto Bertogli, Apr 14, 2008
  6. Junio C HamanoApr 16, 2008
  7. Johannes SchindelinApr 14, 2008

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.