Let's take the 0-child case. With v1.7.4-rc3:
$ GIT_TRACE=1; export GIT_TRACE
$ git symbolic-ref confused
setup: git_dir: .git
setup: worktree: /home/jrn/src/git
setup: cwd: /home/jrn/src/git
setup: prefix: (null)
trace: built-in: git 'symbolic-ref' 'confused'
fatal: ref confused is not a symbolic ref
$ git rev-parse confused >/dev/null
trace: built-in: git 'rev-parse' 'confused'
fatal: ambiguous argument 'confused': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
Observations:
- Orthogonal to the useful quantity of information is that it would be
nice if the setup info dump were consistent. Currently non-builtins
and commands like rev-parse without RUN_SETUP|RUN_SETUP_GENTLY skip
it.
- Except for "cwd", the setup lines write information that is easy to
retrieve with git rev-parse. In my limited experience, it is not
the information I need when debugging.
- The cwd, on the other hand, could be very useful. Maybe git should
make sense to always follow "trace: run_command", "trace: exec", and
"trace: built-in" lines with "trace: cwd".