git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Documentation: talk about pager in api-trace.txt
@ 2016-03-07 10:38 Christian Couder
  2016-03-07 20:23 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Couder @ 2016-03-07 10:38 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Ævar Arnfjörð Bjarmason,
	Karsten Blees, Christian Couder

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 Documentation/technical/api-trace.txt | 44 +++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/Documentation/technical/api-trace.txt b/Documentation/technical/api-trace.txt
index 097a651..0e1af02 100644
--- a/Documentation/technical/api-trace.txt
+++ b/Documentation/technical/api-trace.txt
@@ -95,3 +95,47 @@ 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
+------------
+
-- 
2.8.0.rc0.1.gd285ab0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] Documentation: talk about pager in api-trace.txt
  2016-03-07 10:38 [PATCH v2] Documentation: talk about pager in api-trace.txt Christian Couder
@ 2016-03-07 20:23 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2016-03-07 20:23 UTC (permalink / raw)
  To: Christian Couder
  Cc: git, Jeff King, Ævar Arnfjörð Bjarmason,
	Karsten Blees, Christian Couder

Christian Couder <christian.couder@gmail.com> writes:

> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
>  Documentation/technical/api-trace.txt | 44 +++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)

I think this is fine. I'm not sure how many people would look at the
technical/api documentation in such a case, but I don't think it hurts
to document this stuff.

Having re-read this, I have a feeling that this is purely "Caveats",
not "Bugs & Caveats", though.

Will queue, but this will not be so urgent for 2.8.

> diff --git a/Documentation/technical/api-trace.txt b/Documentation/technical/api-trace.txt
> index 097a651..0e1af02 100644
> --- a/Documentation/technical/api-trace.txt
> +++ b/Documentation/technical/api-trace.txt
> @@ -95,3 +95,47 @@ 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
> +------------
> +

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-07 20:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 10:38 [PATCH v2] Documentation: talk about pager in api-trace.txt Christian Couder
2016-03-07 20:23 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).