git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] sub-process: print the cmd when a capability is unsupported
@ 2017-08-16 12:40 Christian Couder
  2017-08-16 14:06 ` Ben Peart
  2017-08-16 15:48 ` Lars Schneider
  0 siblings, 2 replies; 8+ messages in thread
From: Christian Couder @ 2017-08-16 12:40 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Ben Peart, Jonathan Tan,
	Lars Schneider, Jonathan Nieder, Christian Couder

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-09-12 12:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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 NNTP newsgroup(s).