From: Christian Couder <hidden> Date: 2017-08-15 17:36:35
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.
Signed-off-by: Christian Couder <redacted>
---
sub-process.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
From: Jonathan Tan <hidden> Date: 2017-08-15 18:17:38
On Tue, 15 Aug 2017 19:36:11 +0200
Christian Couder [off-list ref] 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.
Signed-off-by: Christian Couder <redacted>
This looks reasonable to me.
I am still wondering if protocol errors should be fatal, but that is
unrelated to this patch.
From: Lars Schneider <hidden> Date: 2017-08-15 19:01:02
quoted hunk
On 15 Aug 2017, at 19:36, Christian Couder [off-list ref] 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.
Signed-off-by: Christian Couder <redacted>
---
sub-process.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
From: Ben Peart <hidden> Date: 2017-08-15 19:01:24
On 8/15/2017 1:36 PM, Christian Couder wrote:
quoted hunk
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.
Signed-off-by: Christian Couder <redacted>
---
sub-process.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
From: Christian Couder <hidden> Date: 2017-08-15 19:29:49
On Tue, Aug 15, 2017 at 9:00 PM, Lars Schneider
[off-list ref] wrote:
quoted
On 15 Aug 2017, at 19:36, Christian Couder [off-list ref] 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.
Signed-off-by: Christian Couder <redacted>
---
sub-process.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
Wouldn't it be possible to use "process->argv[0]"?
Shouldn't that be the same as "cmd"?
Well in sub-process.h there is:
/* Members should not be accessed directly. */
struct subprocess_entry {
struct hashmap_entry ent; /* must be the first member! */
const char *cmd;
struct child_process process;
};
so if cmd is always the same as process->argv[0], maybe there is no
need for the cmd member in the first place?
Wouldn't it be possible to use "process->argv[0]"?
Shouldn't that be the same as "cmd"?
Well in sub-process.h there is:
/* Members should not be accessed directly. */
struct subprocess_entry {
struct hashmap_entry ent; /* must be the first member! */
const char *cmd;
struct child_process process;
};
so if cmd is always the same as process->argv[0], maybe there is no
need for the cmd member in the first place?
In case it is not clear, what I mean is that if we consider that they
should always be the same, it could be considered a different patch
altogether to just remove the cmd member of this struct.
From: Lars Schneider <hidden> Date: 2017-08-15 19:35:39
On 15 Aug 2017, at 21:29, Christian Couder [off-list ref] wrote:
On Tue, Aug 15, 2017 at 9:00 PM, Lars Schneider
[off-list ref] wrote:
quoted
quoted
On 15 Aug 2017, at 19:36, Christian Couder [off-list ref] 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.
Signed-off-by: Christian Couder <redacted>
---
sub-process.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
Wouldn't it be possible to use "process->argv[0]"?
Shouldn't that be the same as "cmd"?
Well in sub-process.h there is:
/* Members should not be accessed directly. */
struct subprocess_entry {
struct hashmap_entry ent; /* must be the first member! */
const char *cmd;
struct child_process process;
};
so if cmd is always the same as process->argv[0], maybe there is no
need for the cmd member in the first place?
The struct is a hash map entry. `cmd` is the key for a `process`.
Therefore, I think this is still necessary.
Does this make sense?
- Lars
From: Christian Couder <hidden> Date: 2017-08-15 20:30:30
On Tue, Aug 15, 2017 at 9:35 PM, Lars Schneider
[off-list ref] wrote:
quoted
On 15 Aug 2017, at 21:29, Christian Couder [off-list ref] wrote:
On Tue, Aug 15, 2017 at 9:00 PM, Lars Schneider
[off-list ref] wrote:
quoted
Wouldn't it be possible to use "process->argv[0]"?
Shouldn't that be the same as "cmd"?
Well in sub-process.h there is:
/* Members should not be accessed directly. */
struct subprocess_entry {
struct hashmap_entry ent; /* must be the first member! */
const char *cmd;
struct child_process process;
};
so if cmd is always the same as process->argv[0], maybe there is no
need for the cmd member in the first place?
The struct is a hash map entry. `cmd` is the key for a `process`.
Therefore, I think this is still necessary.
Does this make sense?
Not sure it makes sense. A quick try to remove the cmd member, failed
t0021 with:
Initialized empty Git repository in /home/christian/git/git/t/trash
directory.t0021-conversion/repo/.git/
[master (root-commit) 56d459b] test commit 1
Author: A U Thor [off-list ref]
1 file changed, 1 insertion(+)
create mode 100644 .gitattributes
From: Jonathan Nieder <hidden> Date: 2017-08-16 00:23:08
Jonathan Tan wrote:
Christian Couder [off-list ref] wrote:
quoted
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.
[...]
quoted
Let's improve the warning() message, so that we can know which
subprocess cmd failed.
Signed-off-by: Christian Couder <redacted>
This looks reasonable to me.
I am still wondering if protocol errors should be fatal,
From: Christian Couder <hidden> Date: 2017-08-16 12:37:10
On Wed, Aug 16, 2017 at 2:22 AM, Jonathan Nieder [off-list ref] wrote:
Jonathan Tan wrote:
quoted
Christian Couder [off-list ref] wrote:
quoted
quoted
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.
[...]
quoted
quoted
Let's improve the warning() message, so that we can know which
subprocess cmd failed.
Signed-off-by: Christian Couder <redacted>
This looks reasonable to me.
I am still wondering if protocol errors should be fatal,
Yes, please.
Unfortunately I think it would prevent new filters or new
sub-processes to work with older versions of Git.
For example if filters are upgraded company wide to support the new
"delay" capability, that would force everyone using the filters to
upgrade Git.