Re: [PATCH v4 6/7] trace.c: print env vars in trace_run_command()

2018-01-16 Thread Junio C Hamano
Stefan Beller writes: > On Tue, Jan 16, 2018 at 2:13 PM, Junio C Hamano wrote: >> Nguyễn Thái Ngọc Duy writes: >> >>> +test_trace() { >>> + local expected="$1" >> >> Style: "test_trace () {" is how we start a shell function. >>

Re: [PATCH v4 6/7] trace.c: print env vars in trace_run_command()

2018-01-16 Thread Stefan Beller
On Tue, Jan 16, 2018 at 2:13 PM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> +test_trace() { >> + local expected="$1" > > Style: "test_trace () {" is how we start a shell function. > Portability: we do not use "local". > >> + shift >>

Re: [PATCH v4 6/7] trace.c: print env vars in trace_run_command()

2018-01-16 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > +test_trace() { > + local expected="$1" Style: "test_trace () {" is how we start a shell function. Portability: we do not use "local". > + shift > + GIT_TRACE=1 test-run-command "$@" run-command true 2>&1 >/dev/null | \ > +

Re: [PATCH v4 6/7] trace.c: print env vars in trace_run_command()

2018-01-12 Thread Jeff King
On Sat, Jan 13, 2018 at 01:49:48PM +0700, Nguyễn Thái Ngọc Duy wrote: > diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c > index d24d157379..0ab71f14fb 100644 > --- a/t/helper/test-run-command.c > +++ b/t/helper/test-run-command.c > @@ -56,6 +56,10 @@ int cmd_main(int argc,

[PATCH v4 6/7] trace.c: print env vars in trace_run_command()

2018-01-12 Thread Nguyễn Thái Ngọc Duy
Occasionally submodule code could execute new commands with GIT_DIR set to some submodule. GIT_TRACE prints just the command line which makes it hard to tell that it's not really executed on this repository. Print the env delta (compared to parent environment) in this case. Helped-by: Junio C