git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Lars Schneider <larsxschneider@gmail.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: Git Users <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
	Ben Peart <Ben.Peart@microsoft.com>,
	Jonathan Tan <jonathantanmy@google.com>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH v2] sub-process: print the cmd when a capability is unsupported
Date: Wed, 16 Aug 2017 17:48:47 +0200	[thread overview]
Message-ID: <C7814B93-B103-4D77-B815-2AFC1A9CB566@gmail.com> (raw)
In-Reply-To: <20170816124036.25236-1-chriscool@tuxfamily.org>


> On 16 Aug 2017, at 14:40, Christian Couder <christian.couder@gmail.com> wrote:
> 
> In handshake_capabilities() we use warning() when a capability
> is not supported, so the exit code of the function is 0 and no
> further error is shown. This is a problem because the warning
> message doesn't tell us which subprocess cmd failed.
> 
> On the contrary if we cannot write a packet from this function,
> we use error() and then subprocess_start() outputs:
> 
>    initialization for subprocess '<cmd>' failed
> 
> so we can know which subprocess cmd failed.
> 
> Let's improve the warning() message, so that we can know which
> subprocess cmd failed.
> 
> Helped-by: Lars Schneider <larsxschneider@gmail.com>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
> Change since previous version:
> 
>  - Use process->argv[0] instead of adding a new parameter to
>    handshake_capabilities(), thanks to Lars.
> 
> sub-process.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sub-process.c b/sub-process.c
> index 6edb97c1c6..6ccfaaba99 100644
> --- a/sub-process.c
> +++ b/sub-process.c
> @@ -184,8 +184,8 @@ static int handshake_capabilities(struct child_process *process,
> 			if (supported_capabilities)
> 				*supported_capabilities |= capabilities[i].flag;
> 		} else {
> -			warning("external filter requested unsupported filter capability '%s'",
> -				p);
> +			warning("subprocess '%s' requested unsupported capability '%s'",
> +				process->argv[0], p);
> 		}
> 	}
> 
> -- 
> 2.14.1.146.g7de11f915a
> 

Looks good to me.

Thanks,
Lars

      parent reply	other threads:[~2017-08-16 15:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16 12:40 [PATCH v2] sub-process: print the cmd when a capability is unsupported Christian Couder
2017-08-16 14:06 ` Ben Peart
2017-08-16 16:41   ` Junio C Hamano
2017-08-16 21:55     ` Junio C Hamano
2017-09-11  3:27       ` Junio C Hamano
2017-09-11 12:34         ` Ben Peart
2017-09-12 12:02         ` Lars Schneider
2017-08-16 15:48 ` Lars Schneider [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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C7814B93-B103-4D77-B815-2AFC1A9CB566@gmail.com \
    --to=larsxschneider@gmail.com \
    --cc=Ben.Peart@microsoft.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@google.com \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).