Re: [PATCH v3 0/4] run-command.c: print env vars when GIT_TRACE is set
- From
Stefan Beller <sbeller@google.com>
- Date
- Jan 12, 2018, 18:06 UTC
- Message-ID
- <CAGZ79kZRFCLEtyWCjKm-vM36Gf1EJfEAAFxEFz0wQHv4bqPc_A@mail.gmail.com>
- In-Reply-To
- <20180112133613.GF27499@sigill.intra.peff.net>
On Fri, Jan 12, 2018 at 5:36 AM, Jeff King <peff@peff.net> wrote:
Show 28 quoted lines
> On Fri, Jan 12, 2018 at 04:56:03PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> v3 turns a single patch into a series. Changes from v2 >> >> - env var quoting is now done correctly (from shell syntax perspective) >> - the program name is prepended in git_cmd mode >> - cwd is now printed too (because I have too, see 4/4) >> - we don't blindly print the env delta anymore but print the actual >> differences compared to parent env >> - which means we also print "unset XXX" statements in $GIT_TRACE > > Overall I like it, though I raised on corner case in 4/4. > >> The new output on git.git looks like this >> >> trace: run_command: cd 'sha1collisiondetection'; unset GIT_PREFIX; GIT_DIR='.git' git 'status' '--porcelain=2' >> >> a bit longer than I would like, but that's because of >> sha1collisiondetection and it's not long enough for me to invent >> $GIT_TRACE_EXEC. > > IMHO the unconditional single-quotes make this longer and uglier than it > needs to be. I've often been tempted to have them kick in only when > necessary. Here are some patches to do that (on top of yours). > > [5/4]: sq_quote_argv: drop maxlen parameter > [6/4]: trace: avoid unnecessary quoting >
I have reviewed the whole series 6/4 and think they can be applied as-is, though I have not thought about the corner case you mentioned.
Thanks for this series! Stefan