{"thread":{"id":"41635","subject":"[PATCH v2] Documentation: talk about pager in api-trace.txt","startedAt":"2016-03-07T10:38:53Z","lastAt":"2016-03-07T20:23:15Z","messageCount":2,"participants":["Christian Couder","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"280322","messageId":"1457347133-31733-1-git-send-email-chriscool@tuxfamily.org","threadId":"41635","inReplyTo":null,"subject":"[PATCH v2] Documentation: talk about pager in api-trace.txt","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2016-03-07T10:38:53Z","receivedAt":"2016-03-07T10:38:53Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/technical/api-trace.txt | 44 +++++++++++++++++++++++++++++++++++\n 1 file changed, 44 insertions(+)\n\ndiff --git a/Documentation/technical/api-trace.txt b/Documentation/technical/api-trace.txt\nindex 097a651..0e1af02 100644\n--- a/Documentation/technical/api-trace.txt\n+++ b/Documentation/technical/api-trace.txt\n@@ -95,3 +95,47 @@ for (;;) {\n }\n trace_performance(t, \"frotz\");\n ------------\n+\n+Bugs & Caveats\n+--------------\n+\n+GIT_TRACE_* environment variables can be used to tell Git to show\n+trace output to its standard error stream. Git can often spawn a pager\n+internally to run its subcommand and send its standard output and\n+standard error to it.\n+\n+Because GIT_TRACE_PERFORMANCE trace is generated only at the very end\n+of the program with atexit(), which happens after the pager exits, it\n+would not work well if you send its log to the standard error output\n+and let Git spawn the pager at the same time.\n+\n+As a work around, you can for example use '--no-pager', or set\n+GIT_TRACE_PERFORMANCE to another file descriptor which is redirected\n+to stderr, or set GIT_TRACE_PERFORMANCE to a file specified by its\n+absolute path.\n+\n+For example instead of the following command which by default may not\n+print any performance information:\n+\n+------------\n+GIT_TRACE_PERFORMANCE=2 git log -1\n+------------\n+\n+you may want to use:\n+\n+------------\n+GIT_TRACE_PERFORMANCE=2 git --no-pager log -1\n+------------\n+\n+or:\n+\n+------------\n+GIT_TRACE_PERFORMANCE=3 3>&2 git log -1\n+------------\n+\n+or:\n+\n+------------\n+GIT_TRACE_PERFORMANCE=/path/to/log/file git log -1\n+------------\n+\n-- \n2.8.0.rc0.1.gd285ab0\n"},{"id":"280332","messageId":"xmqqvb4yniks.fsf@gitster.mtv.corp.google.com","threadId":"41635","inReplyTo":"1457347133-31733-1-git-send-email-chriscool@tuxfamily.org","subject":"Re: [PATCH v2] Documentation: talk about pager in api-trace.txt","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-07T20:23:15Z","receivedAt":"2016-03-07T20:23:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  Documentation/technical/api-trace.txt | 44 +++++++++++++++++++++++++++++++++++\n>  1 file changed, 44 insertions(+)\n\nI think this is fine. I'm not sure how many people would look at the\ntechnical/api documentation in such a case, but I don't think it hurts\nto document this stuff.\n\nHaving re-read this, I have a feeling that this is purely \"Caveats\",\nnot \"Bugs & Caveats\", though.\n\nWill queue, but this will not be so urgent for 2.8.\n\n> diff --git a/Documentation/technical/api-trace.txt b/Documentation/technical/api-trace.txt\n> index 097a651..0e1af02 100644\n> --- a/Documentation/technical/api-trace.txt\n> +++ b/Documentation/technical/api-trace.txt\n> @@ -95,3 +95,47 @@ for (;;) {\n>  }\n>  trace_performance(t, \"frotz\");\n>  ------------\n> +\n> +Bugs & Caveats\n> +--------------\n> +\n> +GIT_TRACE_* environment variables can be used to tell Git to show\n> +trace output to its standard error stream. Git can often spawn a pager\n> +internally to run its subcommand and send its standard output and\n> +standard error to it.\n> +\n> +Because GIT_TRACE_PERFORMANCE trace is generated only at the very end\n> +of the program with atexit(), which happens after the pager exits, it\n> +would not work well if you send its log to the standard error output\n> +and let Git spawn the pager at the same time.\n> +\n> +As a work around, you can for example use '--no-pager', or set\n> +GIT_TRACE_PERFORMANCE to another file descriptor which is redirected\n> +to stderr, or set GIT_TRACE_PERFORMANCE to a file specified by its\n> +absolute path.\n> +\n> +For example instead of the following command which by default may not\n> +print any performance information:\n> +\n> +------------\n> +GIT_TRACE_PERFORMANCE=2 git log -1\n> +------------\n> +\n> +you may want to use:\n> +\n> +------------\n> +GIT_TRACE_PERFORMANCE=2 git --no-pager log -1\n> +------------\n> +\n> +or:\n> +\n> +------------\n> +GIT_TRACE_PERFORMANCE=3 3>&2 git log -1\n> +------------\n> +\n> +or:\n> +\n> +------------\n> +GIT_TRACE_PERFORMANCE=/path/to/log/file git log -1\n> +------------\n> +\n"}]}