File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,3 +95,46 @@ for (;;) {
9595}
9696trace_performance(t, "frotz");
9797------------
98+
99+ Bugs & Caveats
100+ --------------
101+
102+ GIT_TRACE_* environment variables can be used to tell Git to show
103+ trace output to its standard error stream. Git can often spawn a pager
104+ internally to run its subcommand and send its standard output and
105+ standard error to it.
106+
107+ Because GIT_TRACE_PERFORMANCE trace is generated only at the very end
108+ of the program with atexit(), which happens after the pager exits, it
109+ would not work well if you send its log to the standard error output
110+ and let Git spawn the pager at the same time.
111+
112+ As a work around, you can for example use '--no-pager', or set
113+ GIT_TRACE_PERFORMANCE to another file descriptor which is redirected
114+ to stderr, or set GIT_TRACE_PERFORMANCE to a file specified by its
115+ absolute path.
116+
117+ For example instead of the following command which by default may not
118+ print any performance information:
119+
120+ ------------
121+ GIT_TRACE_PERFORMANCE=2 git log -1
122+ ------------
123+
124+ you may want to use:
125+
126+ ------------
127+ GIT_TRACE_PERFORMANCE=2 git --no-pager log -1
128+ ------------
129+
130+ or:
131+
132+ ------------
133+ GIT_TRACE_PERFORMANCE=3 3>&2 git log -1
134+ ------------
135+
136+ or:
137+
138+ ------------
139+ GIT_TRACE_PERFORMANCE=/path/to/log/file git log -1
140+ ------------
You can’t perform that action at this time.
0 commit comments