From: Junio C Hamano Date: Wed, 13 Apr 2016 21:12:38 +0000 (-0700) Subject: Merge branch 'ep/trace-doc-sample-fix' X-Git-Tag: v2.9.0-rc0~120 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b330051982756f2f18a6718e603ceb99302dc16e?hp=-c Merge branch 'ep/trace-doc-sample-fix' Fix a typo in an example in the trace API documentation. * ep/trace-doc-sample-fix: api-trace.txt: fix typo --- b330051982756f2f18a6718e603ceb99302dc16e diff --combined Documentation/technical/api-trace.txt index 389ae16d15,0aa0fda2c9..fadb5979c4 --- a/Documentation/technical/api-trace.txt +++ b/Documentation/technical/api-trace.txt @@@ -28,7 -28,7 +28,7 @@@ static struct trace_key trace_foo = TRA static void trace_print_foo(const char *message) { - trace_print_key(&trace_foo, message); + trace_printf_key(&trace_foo, "%s", message); } ------------ + @@@ -95,46 -95,3 +95,46 @@@ for (;;) } trace_performance(t, "frotz"); ------------ + +Bugs & Caveats +-------------- + +GIT_TRACE_* environment variables can be used to tell Git to show +trace output to its standard error stream. Git can often spawn a pager +internally to run its subcommand and send its standard output and +standard error to it. + +Because GIT_TRACE_PERFORMANCE trace is generated only at the very end +of the program with atexit(), which happens after the pager exits, it +would not work well if you send its log to the standard error output +and let Git spawn the pager at the same time. + +As a work around, you can for example use '--no-pager', or set +GIT_TRACE_PERFORMANCE to another file descriptor which is redirected +to stderr, or set GIT_TRACE_PERFORMANCE to a file specified by its +absolute path. + +For example instead of the following command which by default may not +print any performance information: + +------------ +GIT_TRACE_PERFORMANCE=2 git log -1 +------------ + +you may want to use: + +------------ +GIT_TRACE_PERFORMANCE=2 git --no-pager log -1 +------------ + +or: + +------------ +GIT_TRACE_PERFORMANCE=3 3>&2 git log -1 +------------ + +or: + +------------ +GIT_TRACE_PERFORMANCE=/path/to/log/file git log -1 +------------