From: Christian Couder Date: Wed, 16 Aug 2017 12:40:36 +0000 (+0200) Subject: sub-process: print the cmd when a capability is unsupported X-Git-Tag: v2.14.2~26^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3ba566342a4fd81b24d926efc35506d58e10a19;p=thirdparty%2Fgit.git sub-process: print the cmd when a capability is unsupported 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 '' 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 Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- diff --git a/sub-process.c b/sub-process.c index 86de8d7bfb..fcc4832c14 100644 --- a/sub-process.c +++ b/sub-process.c @@ -181,8 +181,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); } }