Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
convert: quote filter names in error messages
author
Lars Schneider
<larsxschneider@gmail.com>
Sun, 16 Oct 2016 23:20:25 +0000
(16:20 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 17 Oct 2016 18:36:49 +0000
(11:36 -0700)
Git filter driver commands with spaces (e.g. `filter.sh foo`) are hard
to read in error messages. Quote them to improve the readability.
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
convert.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
35f6318
)
diff --git
a/convert.c
b/convert.c
index 077f5e601e3283b7b2566bff791290209be4694e..986c23975bb6fbed1d98d042acdc9a852bd6b9fa 100644
(file)
--- a/
convert.c
+++ b/
convert.c
@@
-412,7
+412,7
@@
static int filter_buffer_or_fd(int in, int out, void *data)
child_process.out = out;
if (start_command(&child_process))
child_process.out = out;
if (start_command(&child_process))
- return error("cannot fork to run external filter
%s
", params->cmd);
+ return error("cannot fork to run external filter
'%s'
", params->cmd);
sigchain_push(SIGPIPE, SIG_IGN);
sigchain_push(SIGPIPE, SIG_IGN);
@@
-430,13
+430,13
@@
static int filter_buffer_or_fd(int in, int out, void *data)
if (close(child_process.in))
write_err = 1;
if (write_err)
if (close(child_process.in))
write_err = 1;
if (write_err)
- error("cannot feed the input to external filter
%s
", params->cmd);
+ error("cannot feed the input to external filter
'%s'
", params->cmd);
sigchain_pop(SIGPIPE);
status = finish_command(&child_process);
if (status)
sigchain_pop(SIGPIPE);
status = finish_command(&child_process);
if (status)
- error("external filter
%s
failed %d", params->cmd, status);
+ error("external filter
'%s'
failed %d", params->cmd, status);
strbuf_release(&cmd);
return (write_err || status);
strbuf_release(&cmd);
return (write_err || status);
@@
-477,15
+477,15
@@
static int apply_filter(const char *path, const char *src, size_t len, int fd,
return 0; /* error was already reported */
if (strbuf_read(&nbuf, async.out, len) < 0) {
return 0; /* error was already reported */
if (strbuf_read(&nbuf, async.out, len) < 0) {
- error("read from external filter
%s
failed", cmd);
+ error("read from external filter
'%s'
failed", cmd);
ret = 0;
}
if (close(async.out)) {
ret = 0;
}
if (close(async.out)) {
- error("read from external filter
%s
failed", cmd);
+ error("read from external filter
'%s'
failed", cmd);
ret = 0;
}
if (finish_async(&async)) {
ret = 0;
}
if (finish_async(&async)) {
- error("external filter
%s
failed", cmd);
+ error("external filter
'%s'
failed", cmd);
ret = 0;
}
ret = 0;
}