• Jeff King's avatar
    trace: avoid unnecessary quoting · 1fbdab21
    Jeff King authored
    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
      - 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: default avatarJeff King <[email protected]>
    Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: default avatarJunio C Hamano <[email protected]>
trace.c 10.3 KB