summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-04-06 18:39:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-04-06 18:39:04 (GMT)
commit5e533f8ffd12cdc2d20283c3900fc3561d449b82 (patch)
tree550494b591a0e84d1950dde540de4772fad83afc /Documentation
parent235bdc8c895fa2307055bfb8ea67632b4cb79cc7 (diff)
parent3bd1b51d3a3884df186beddaf3a101a5e624f07a (diff)
downloadgit-5e533f8ffd12cdc2d20283c3900fc3561d449b82.zip
git-5e533f8ffd12cdc2d20283c3900fc3561d449b82.tar.gz
git-5e533f8ffd12cdc2d20283c3900fc3561d449b82.tar.bz2
Merge branch 'cc/doc-recommend-performance-trace-to-file'
A minor documentation update. * cc/doc-recommend-performance-trace-to-file: Documentation: talk about pager in api-trace.txt
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/technical/api-trace.txt43
1 files changed, 43 insertions, 0 deletions
diff --git a/Documentation/technical/api-trace.txt b/Documentation/technical/api-trace.txt
index 097a651..389ae16 100644
--- a/Documentation/technical/api-trace.txt
+++ b/Documentation/technical/api-trace.txt
@@ -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
+------------