Git development
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Alberto Bertogli <albertito@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] builtin-apply: Show a more descriptive error on failure when opening a patch
Date: Mon, 14 Apr 2008 15:03:45 +0100 (BST)	[thread overview]
Message-ID: <alpine.DEB.1.00.0804141502590.28504@racer> (raw)
In-Reply-To: <1208112991-21598-1-git-send-email-albertito@gmail.com>

Hi,

On Sun, 13 Apr 2008, Alberto Bertogli wrote:

> 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

      parent reply	other threads:[~2008-04-14 14:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-13 18:56 [PATCH] builtin-apply: Show a more descriptive error on failure when opening a patch Alberto Bertogli
2008-04-13 19:54 ` Junio C Hamano
2008-04-14 14:23   ` Alberto Bertogli
2008-04-14 14:33     ` Johannes Schindelin
2008-04-14 15:30       ` Alberto Bertogli
2008-04-16  5:20         ` Junio C Hamano
2008-04-14 14:03 ` Johannes Schindelin [this message]

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=alpine.DEB.1.00.0804141502590.28504@racer \
    --to=johannes.schindelin@gmx.de \
    --cc=albertito@gmail.com \
    --cc=git@vger.kernel.org \
    /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