Skip to content

Commit 4e0d3aa

Browse files
szedergitster
authored andcommitted
trace2: document the supported values of GIT_TRACE2* env variables
The descriptions of the GIT_TRACE2* environment variables link to the technical docs for further details on the supported values. However, a link like this only really works if the docs are viewed in a browser and the full documentation is available. OTOH, in 'man git' there are no links to conveniently click on, and distro-shipped git packages tend to include only the man pages, while the technical docs and the docs in html format are in a separate 'git-doc' package. So let's describe the supported values to make the manpage more self-contained, but still keep the references to the technical docs because the details of the SID, and the JSON and perf output formats are definitely beyond the scope of 'man git'. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e4b75d6 commit 4e0d3aa

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

Documentation/git.txt

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -665,21 +665,48 @@ of clones and fetches.
665665
Output from `GIT_TRACE2` is a simple text-based format for human
666666
readability.
667667
+
668-
The `GIT_TRACE2` variables can take many values. Any value available to
669-
the `GIT_TRACE` variables is also available to `GIT_TRACE2`. The `GIT_TRACE2`
670-
variables can also specify a Unix Domain Socket. See
671-
link:technical/api-trace2.html[Trace2 documentation] for full details.
668+
If this variable is set to "1", "2" or "true" (comparison
669+
is case insensitive), trace messages will be printed to
670+
stderr.
671+
+
672+
If the variable is set to an integer value greater than 2
673+
and lower than 10 (strictly) then Git will interpret this
674+
value as an open file descriptor and will try to write the
675+
trace messages into this file descriptor.
676+
+
677+
Alternatively, if the variable is set to an absolute path
678+
(starting with a '/' character), Git will interpret this
679+
as a file path and will try to append the trace messages
680+
to it. If the path already exists and is a directory, the
681+
trace messages will be written to files (one per process)
682+
in that directory, named according to the last component
683+
of the SID and an optional counter (to avoid filename
684+
collisions).
685+
+
686+
In addition, if the variable is set to
687+
`af_unix:[<socket_type>:]<absolute-pathname>`, Git will try
688+
to open the path as a Unix Domain Socket. The socket type
689+
can be either `stream` or `dgram`.
690+
+
691+
Unsetting the variable, or setting it to empty, "0" or
692+
"false" (case insensitive) disables trace messages.
693+
+
694+
See link:technical/api-trace2.html[Trace2 documentation]
695+
for full details.
696+
672697

673698
`GIT_TRACE2_EVENT`::
674699
This setting writes a JSON-based format that is suited for machine
675-
interpretation. See link:technical/api-trace2.html[Trace2 documentation]
676-
for full details.
700+
interpretation.
701+
See `GIT_TRACE2` for available trace output options and
702+
link:technical/api-trace2.html[Trace2 documentation] for full details.
677703

678704
`GIT_TRACE2_PERF`::
679705
In addition to the text-based messages available in `GIT_TRACE2`, this
680706
setting writes a column-based format for understanding nesting
681-
regions. See link:technical/api-trace2.html[Trace2 documentation]
682-
for full details.
707+
regions.
708+
See `GIT_TRACE2` for available trace output options and
709+
link:technical/api-trace2.html[Trace2 documentation] for full details.
683710

684711
`GIT_REDACT_COOKIES`::
685712
This can be set to a comma-separated list of strings. When a curl trace

0 commit comments

Comments
 (0)