Re: [PATCH v3 0/4] run-command.c: print env vars when GIT_TRACE is set
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jan 13, 2018, 06:54 UTC
- Message-ID
- <CACsJy8BagXM=A6+yd9GbBxp-_Ht5Og1_LqkUQGhd+dqkMvKP9Q@mail.gmail.com>
- In-Reply-To
- <CAGZ79kYUyugA_BhMgr_k1aWfxg9+cNbOcVO+LOZkZ1YAAu7_mQ@mail.gmail.com>
On Sat, Jan 13, 2018 at 12:19 AM, Stefan Beller <sbeller@google.com> wrote:
Show 8 quoted lines
>> Oh.. before anybody asks, I'm not adding git prefix to the "cd" part. >> You're supposed to know that git moves back to worktree top dir when >> you read $GIT_TRACE (or are welcome to improve the print out). > > Heh. Would appending "; cd -" solve the issue? (Though I would argue > we don't need or want to add that actually, as you'd want to copy and run > the command and surely want to run more tests in that directory afterwards. > I mean you're debugging, right?)
The problem is if you are tracing in a subdir foo/bar and the trace output says "cd xyz". You can' just copy and execute that command and have to do "cd ../../xyz". I don't see how "cd -" would solve that. Printing "cd $(git rev-parse --show-cdup)/xyz" could solve it without passing the prefix down to this trace function. I guess. But then that command depends on $GIT_DIR. If your $GIT_DIR is being changed (i.e. submodules), it gets ugly again.
-- Duy