diff options
| author | Jeff King <peff@peff.net> | 2018-01-15 17:59:44 +0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-01-16 12:16:54 -0800 |
| commit | 1fbdab21bb452ca4732bf088539247047465b99d (patch) | |
| tree | 1b9f8229b5588ed959ebf0c7738856ebe3f3238f /t/helper/test-run-command.c | |
| parent | sq_quote_argv: drop maxlen parameter (diff) | |
| download | git-1fbdab21bb452ca4732bf088539247047465b99d.tar.gz git-1fbdab21bb452ca4732bf088539247047465b99d.zip | |
trace: avoid unnecessary quoting
Trace output which contains arbitrary strings (e.g., the
arguments to commands which we are running) is always passed
through sq_quote_buf(). That function always adds
single-quotes, even if the output consists of vanilla
characters. This can make the output a bit hard to read.
Let's avoid the quoting if there are no characters which a
shell would interpret. Trace output doesn't necessarily need
to be shell-compatible, but:
- the shell language is a good ballpark for what humans
consider readable (well, humans versed in command line
tools)
- the run_command bits can be cut-and-pasted to a shell,
and we'll keep that property
- it covers any cases which would make the output
visually ambiguous (e.g., embedded whitespace or quotes)
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-run-command.c')
0 files changed, 0 insertions, 0 deletions
