trace2: rename environment variables to GIT_TRACE2*
For an environment variable that is supposed to be set by users, the
GIT_TR2* env vars are just too unclear, inconsistent, and ugly.
Most of the established GIT_* environment variables don't use
abbreviations, and in case of the few that do (GIT_DIR,
GIT_COMMON_DIR, GIT_DIFF_OPTS) it's quite obvious what the
abbreviations (DIR and OPTS) stand for. But what does TR stand for?
Track, traditional, trailer, transaction, transfer, transformation,
transition, translation, transplant, transport, traversal, tree,
trigger, truncate, trust, or ...?!
The trace2 facility, as the '2' suffix in its name suggests, is
supposed to eventually supercede Git's original trace facility. It's
reasonable to expect that the corresponding environment variables
follow suit, and after the original GIT_TRACE variables they are
called GIT_TRACE2; there is no such thing is 'GIT_TR'.
All trace2-specific config variables are, very sensibly, in the
'trace2' section, not in 'tr2'.
OTOH, we don't gain anything at all by omitting the last three
characters of "trace" from the names of these environment variables.
So let's rename all GIT_TR2* environment variables to GIT_TRACE2*,
before they make their way into a stable release.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
@ -23,7 +23,7 @@ formats in the future. This might be used to define a binary format,
@@ -23,7 +23,7 @@ formats in the future. This might be used to define a binary format,
for example.
Trace2 is controlled using `trace2.*` config values in the system and
global config files and `GIT_TR2*` environment variables. Trace2 does
global config files and `GIT_TRACE2*` environment variables. Trace2 does
not read from repo local or worktree config files or respect `-c`
The event format target is a JSON-based format of event data suitable
for telemetry analysis. This format is enabled with the `GIT_TR2_EVENT`
for telemetry analysis. This format is enabled with the `GIT_TRACE2_EVENT`
environment variable or the `trace2.eventTarget` system or global config
setting.
For example
------------
$ export GIT_TR2_EVENT=~/log.event
$ export GIT_TRACE2_EVENT=~/log.event
$ git version
git version 2.20.1.155.g426c96fcdb
------------
@ -273,7 +273,7 @@ significantly affects program performance or behavior, such as
@@ -273,7 +273,7 @@ significantly affects program performance or behavior, such as
Emits a "def_param" messages for "important" configuration
settings.
+
The environment variable `GIT_TR2_CONFIG_PARAMS` or the `trace2.configParams`
The environment variable `GIT_TRACE2_CONFIG_PARAMS` or the `trace2.configParams`
config value can be set to a
list of patterns of important configuration settings, for example:
`core.*,remote.*.url`. This function will iterate over all config
@ -465,7 +465,7 @@ Events are written as lines of the form:
@@ -465,7 +465,7 @@ Events are written as lines of the form:
Note that this may contain embedded LF or CRLF characters that are
not escaped, so the event may spill across multiple lines.
If `GIT_TR2_BRIEF` or `trace2.normalBrief` is true, the `time`, `filename`,
If `GIT_TRACE2_BRIEF` or `trace2.normalBrief` is true, the `time`, `filename`,
and `line` fields are omitted.
This target is intended to be more of a summary (like GIT_TRACE) and
@ -533,7 +533,7 @@ This field is in anticipation of in-proc submodules in the future.
@@ -533,7 +533,7 @@ This field is in anticipation of in-proc submodules in the future.
15:33:33.532712 wt-status.c:2331 | d0 | main | region_leave | r1 | 0.127568 | 0.001504 | status | label:print
------------
If `GIT_TR2_PERF_BRIEF` or `trace2.perfBrief` is true, the `time`, `file`,
If `GIT_TRACE2_PERF_BRIEF` or `trace2.perfBrief` is true, the `time`, `file`,
and `line` fields are omitted.
------------
@ -598,7 +598,7 @@ The following key/value pairs are common to all events:
@@ -598,7 +598,7 @@ The following key/value pairs are common to all events:
`"repo":<repo-id>`::
when present, is the integer repo-id as described previously.
If `GIT_TR2_EVENT_BRIEF` or `trace2.eventBrief` is true, the `file`
If `GIT_TRACE2_EVENT_BRIEF` or `trace2.eventBrief` is true, the `file`
and `line` fields are omitted from all events and the `time` field is
The `category` field may be used in a future enhancement to
do category-based filtering.
+
`GIT_TR2_EVENT_NESTING` or `trace2.eventNesting` can be used to
`GIT_TRACE2_EVENT_NESTING` or `trace2.eventNesting` can be used to
filter deeply nested regions and data events. It defaults to "2".
`"region_leave"`::
@ -1039,8 +1039,8 @@ rev-list, and gc. This example also shows that fetch took
@@ -1039,8 +1039,8 @@ rev-list, and gc. This example also shows that fetch took
5.199 seconds and of that 4.932 was in ssh.
+
----------------
$ export GIT_TR2_BRIEF=1
$ export GIT_TR2=~/log.normal
$ export GIT_TRACE2_BRIEF=1
$ export GIT_TRACE2=~/log.normal
$ git fetch origin
...
----------------
@ -1075,8 +1075,8 @@ its name as "gc", it also reports the hierarchy as "fetch/gc".
@@ -1075,8 +1075,8 @@ its name as "gc", it also reports the hierarchy as "fetch/gc".
indented for clarity.)
+
----------------
$ export GIT_TR2_BRIEF=1
$ export GIT_TR2=~/log.normal
$ export GIT_TRACE2_BRIEF=1
$ export GIT_TRACE2=~/log.normal
$ git fetch origin
...
----------------
@ -1134,8 +1134,8 @@ In this example, scanning for untracked files ran from +0.012568 to
@@ -1134,8 +1134,8 @@ In this example, scanning for untracked files ran from +0.012568 to
+0.027149 (since the process started) and took 0.014581 seconds.
This example shows that the index contained 3552 entries.
+
----------------
$ export GIT_TR2_PERF_BRIEF=1
$ export GIT_TR2_PERF=~/log.perf
$ export GIT_TRACE2_PERF_BRIEF=1
$ export GIT_TRACE2_PERF=~/log.perf
$ git status
...
$ cat ~/log.perf
@ -1310,8 +1310,8 @@ Data events are tagged with the active thread name. They are used
@@ -1310,8 +1310,8 @@ Data events are tagged with the active thread name. They are used
# Add t/helper directory to PATH so that we can use a relative
# path to run nested instances of test-tool.exe (see 004child).
@ -27,12 +27,12 @@ V=$(git version | sed -e 's/^git version //') && export V
@@ -27,12 +27,12 @@ V=$(git version | sed -e 's/^git version //') && export V
# to whatever filtering that target decides to do).
# This script tests the normal target in isolation.
#
# Defer setting GIT_TR2 until the actual command line we want to test
# Defer setting GIT_TRACE2 until the actual command line we want to test
# because hidden git and test-tool commands run by the test harness
# can contaminate our output.
# Enable "brief" feature which turns off "<clock> <file>:<line> " prefix.
GIT_TR2_BRIEF=1 && export GIT_TR2_BRIEF
GIT_TRACE2_BRIEF=1 && export GIT_TRACE2_BRIEF
# Basic tests of the trace2 normal stream. Since this stream is used
# primarily with printf-style debugging/tracing, we do limited testing
# Add t/helper directory to PATH so that we can use a relative
# path to run nested instances of test-tool.exe (see 004child).
@ -27,13 +27,13 @@ V=$(git version | sed -e 's/^git version //') && export V
@@ -27,13 +27,13 @@ V=$(git version | sed -e 's/^git version //') && export V
# to whatever filtering that target decides to do).
# Test each target independently.
#
# Defer setting GIT_TR2_PERF until the actual command we want to
# Defer setting GIT_TRACE2_PERF until the actual command we want to
# test because hidden git and test-tool commands in the test
# harness can contaminate our output.
# Enable "brief" feature which turns off the prefix: