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>

SZEDER Gábor committed May 19, 2019 at 16:43 UTC e4b75d6a1d3105958c307e526ae6759e86f7f837
13 files changed +85 -85
Documentation/config/trace2.txt
+9 -9
@@ -4,17 +4,17 @@ command line arguments are not respected.
4
5 trace2.normalTarget::
6 This variable controls the normal target destination.
7 - It may be overridden by the `GIT_TR2` environment variable.
7 + It may be overridden by the `GIT_TRACE2` environment variable.
8 The following table shows possible values.
9
10 trace2.perfTarget::
11 This variable controls the performance target destination.
12 - It may be overridden by the `GIT_TR2_PERF` environment variable.
12 + It may be overridden by the `GIT_TRACE2_PERF` environment variable.
13 The following table shows possible values.
14
15 trace2.eventTarget::
16 This variable controls the event target destination.
17 - It may be overridden by the `GIT_TR2_EVENT` environment variable.
17 + It may be overridden by the `GIT_TRACE2_EVENT` environment variable.
18 The following table shows possible values.
19 +
20 include::../trace2-target-values.txt[]
@@ -22,22 +22,22 @@ include::../trace2-target-values.txt[]
22 trace2.normalBrief::
23 Boolean. When true `time`, `filename`, and `line` fields are
24 omitted from normal output. May be overridden by the
25 - `GIT_TR2_BRIEF` environment variable. Defaults to false.
25 + `GIT_TRACE2_BRIEF` environment variable. Defaults to false.
26
27 trace2.perfBrief::
28 Boolean. When true `time`, `filename`, and `line` fields are
29 omitted from PERF output. May be overridden by the
30 - `GIT_TR2_PERF_BRIEF` environment variable. Defaults to false.
30 + `GIT_TRACE2_PERF_BRIEF` environment variable. Defaults to false.
31
32 trace2.eventBrief::
33 Boolean. When true `time`, `filename`, and `line` fields are
34 omitted from event output. May be overridden by the
35 - `GIT_TR2_EVENT_BRIEF` environment variable. Defaults to false.
35 + `GIT_TRACE2_EVENT_BRIEF` environment variable. Defaults to false.
36
37 trace2.eventNesting::
38 Integer. Specifies desired depth of nested regions in the
39 event output. Regions deeper than this value will be
40 - omitted. May be overridden by the `GIT_TR2_EVENT_NESTING`
40 + omitted. May be overridden by the `GIT_TRACE2_EVENT_NESTING`
41 environment variable. Defaults to 2.
42
43 trace2.configParams::
@@ -45,7 +45,7 @@ trace2.configParams::
45 settings that should be recorded in the trace2 output.
46 For example, `core.*,remote.*.url` would cause the trace2
47 output to contain events listing each configured remote.
48 - May be overridden by the `GIT_TR2_CONFIG_PARAMS` environment
48 + May be overridden by the `GIT_TRACE2_CONFIG_PARAMS` environment
49 variable. Unset by default.
50
51 trace2.destinationDebug::
@@ -53,4 +53,4 @@ trace2.destinationDebug::
53 trace target destination cannot be opened for writing.
54 By default, these errors are suppressed and tracing is
55 silently disabled. May be overridden by the
56 - `GIT_TR2_DST_DEBUG` environment variable.
56 + `GIT_TRACE2_DST_DEBUG` environment variable.
Documentation/git.txt
+7 -7
@@ -660,23 +660,23 @@ of clones and fetches.
660 When a curl trace is enabled (see `GIT_TRACE_CURL` above), do not dump
661 data (that is, only dump info lines and headers).
662
663 -`GIT_TR2`::
663 +`GIT_TRACE2`::
664 Enables more detailed trace messages from the "trace2" library.
665 - Output from `GIT_TR2` is a simple text-based format for human
665 + Output from `GIT_TRACE2` is a simple text-based format for human
666 readability.
667 +
668 -The `GIT_TR2` variables can take many values. Any value available to
669 -the `GIT_TRACE` variables is also available to `GIT_TR2`. The `GIT_TR2`
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.
672
673 -`GIT_TR2_EVENT`::
673 +`GIT_TRACE2_EVENT`::
674 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.
677
678 -`GIT_TR2_PERF`::
679 - In addition to the text-based messages available in `GIT_TR2`, this
678 +`GIT_TRACE2_PERF`::
679 + In addition to the text-based messages available in `GIT_TRACE2`, this
680 setting writes a column-based format for understanding nesting
681 regions. See link:technical/api-trace2.html[Trace2 documentation]
682 for full details.
Documentation/technical/api-trace2.txt
+23 -23
@@ -23,7 +23,7 @@ formats in the future. This might be used to define a binary format,
23 for example.
24
25 Trace2 is controlled using `trace2.*` config values in the system and
26 -global config files and `GIT_TR2*` environment variables. Trace2 does
26 +global config files and `GIT_TRACE2*` environment variables. Trace2 does
27 not read from repo local or worktree config files or respect `-c`
28 command line config settings.
29
@@ -42,7 +42,7 @@ config setting.
42 For example
43
44 ------------
45 -$ export GIT_TR2=~/log.normal
45 +$ export GIT_TRACE2=~/log.normal
46 $ git version
47 git version 2.20.1.155.g426c96fcdb
48 ------------
@@ -71,13 +71,13 @@ $ cat ~/log.normal
71 The performance format target (PERF) is a column-based format to
72 replace GIT_TRACE_PERFORMANCE and is suitable for development and
73 testing, possibly to complement tools like gprof. This format is
74 -enabled with the `GIT_TR2_PERF` environment variable or the
74 +enabled with the `GIT_TRACE2_PERF` environment variable or the
75 `trace2.perfTarget` system or global config setting.
76
77 For example
78
79 ------------
80 -$ export GIT_TR2_PERF=~/log.perf
80 +$ export GIT_TRACE2_PERF=~/log.perf
81 $ git version
82 git version 2.20.1.155.g426c96fcdb
83 ------------
@@ -104,14 +104,14 @@ $ cat ~/log.perf
104 === The Event Format Target
105
106 The event format target is a JSON-based format of event data suitable
107 -for telemetry analysis. This format is enabled with the `GIT_TR2_EVENT`
107 +for telemetry analysis. This format is enabled with the `GIT_TRACE2_EVENT`
108 environment variable or the `trace2.eventTarget` system or global config
109 setting.
110
111 For example
112
113 ------------
114 -$ export GIT_TR2_EVENT=~/log.event
114 +$ export GIT_TRACE2_EVENT=~/log.event
115 $ git version
116 git version 2.20.1.155.g426c96fcdb
117 ------------
@@ -273,7 +273,7 @@ significantly affects program performance or behavior, such as
273 Emits a "def_param" messages for "important" configuration
274 settings.
275 +
276 -The environment variable `GIT_TR2_CONFIG_PARAMS` or the `trace2.configParams`
276 +The environment variable `GIT_TRACE2_CONFIG_PARAMS` or the `trace2.configParams`
277 config value can be set to a
278 list of patterns of important configuration settings, for example:
279 `core.*,remote.*.url`. This function will iterate over all config
@@ -465,7 +465,7 @@ Events are written as lines of the form:
465 Note that this may contain embedded LF or CRLF characters that are
466 not escaped, so the event may spill across multiple lines.
467
468 -If `GIT_TR2_BRIEF` or `trace2.normalBrief` is true, the `time`, `filename`,
468 +If `GIT_TRACE2_BRIEF` or `trace2.normalBrief` is true, the `time`, `filename`,
469 and `line` fields are omitted.
470
471 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 15:33:33.532712 wt-status.c:2331 | d0 | main | region_leave | r1 | 0.127568 | 0.001504 | status | label:print
534 ------------
535
536 -If `GIT_TR2_PERF_BRIEF` or `trace2.perfBrief` is true, the `time`, `file`,
536 +If `GIT_TRACE2_PERF_BRIEF` or `trace2.perfBrief` is true, the `time`, `file`,
537 and `line` fields are omitted.
538
539 ------------
@@ -598,7 +598,7 @@ The following key/value pairs are common to all events:
598 `"repo":<repo-id>`::
599 when present, is the integer repo-id as described previously.
600
601 -If `GIT_TR2_EVENT_BRIEF` or `trace2.eventBrief` is true, the `file`
601 +If `GIT_TRACE2_EVENT_BRIEF` or `trace2.eventBrief` is true, the `file`
602 and `line` fields are omitted from all events and the `time` field is
603 only present on the "start" and "atexit" events.
604
@@ -911,7 +911,7 @@ visited.
911 The `category` field may be used in a future enhancement to
912 do category-based filtering.
913 +
914 -`GIT_TR2_EVENT_NESTING` or `trace2.eventNesting` can be used to
914 +`GIT_TRACE2_EVENT_NESTING` or `trace2.eventNesting` can be used to
915 filter deeply nested regions and data events. It defaults to "2".
916
917 `"region_leave"`::
@@ -1039,8 +1039,8 @@ rev-list, and gc. This example also shows that fetch took
1039 5.199 seconds and of that 4.932 was in ssh.
1040 +
1041 ----------------
1042 -$ export GIT_TR2_BRIEF=1
1043 -$ export GIT_TR2=~/log.normal
1042 +$ export GIT_TRACE2_BRIEF=1
1043 +$ export GIT_TRACE2=~/log.normal
1044 $ git fetch origin
1045 ...
1046 ----------------
@@ -1075,8 +1075,8 @@ its name as "gc", it also reports the hierarchy as "fetch/gc".
1075 indented for clarity.)
1076 +
1077 ----------------
1078 -$ export GIT_TR2_BRIEF=1
1079 -$ export GIT_TR2=~/log.normal
1078 +$ export GIT_TRACE2_BRIEF=1
1079 +$ export GIT_TRACE2=~/log.normal
1080 $ git fetch origin
1081 ...
1082 ----------------
@@ -1134,8 +1134,8 @@ In this example, scanning for untracked files ran from +0.012568 to
1134 +0.027149 (since the process started) and took 0.014581 seconds.
1135 +
1136 ----------------
1137 -$ export GIT_TR2_PERF_BRIEF=1
1138 -$ export GIT_TR2_PERF=~/log.perf
1137 +$ export GIT_TRACE2_PERF_BRIEF=1
1138 +$ export GIT_TRACE2_PERF=~/log.perf
1139 $ git status
1140 ...
1141
@@ -1180,8 +1180,8 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
1180 We can further investigate the time spent scanning for untracked files.
1181 +
1182 ----------------
1183 -$ export GIT_TR2_PERF_BRIEF=1
1184 -$ export GIT_TR2_PERF=~/log.perf
1183 +$ export GIT_TRACE2_PERF_BRIEF=1
1184 +$ export GIT_TRACE2_PERF=~/log.perf
1185 $ git status
1186 ...
1187 $ cat ~/log.perf
@@ -1236,8 +1236,8 @@ int read_index_from(struct index_state *istate, const char *path,
1236 This example shows that the index contained 3552 entries.
1237 +
1238 ----------------
1239 -$ export GIT_TR2_PERF_BRIEF=1
1240 -$ export GIT_TR2_PERF=~/log.perf
1239 +$ export GIT_TRACE2_PERF_BRIEF=1
1240 +$ export GIT_TRACE2_PERF=~/log.perf
1241 $ git status
1242 ...
1243 $ cat ~/log.perf
@@ -1310,8 +1310,8 @@ Data events are tagged with the active thread name. They are used
1310 to report the per-thread parameters.
1311 +
1312 ----------------
1313 -$ export GIT_TR2_PERF_BRIEF=1
1314 -$ export GIT_TR2_PERF=~/log.perf
1313 +$ export GIT_TRACE2_PERF_BRIEF=1
1314 +$ export GIT_TRACE2_PERF=~/log.perf
1315 $ git status
1316 ...
1317 $ cat ~/log.perf
t/t0001-init.sh
+1 -1
@@ -93,7 +93,7 @@ test_expect_success 'No extra GIT_* on alias scripts' '
93 sed -n \
94 -e "/^GIT_PREFIX=/d" \
95 -e "/^GIT_TEXTDOMAINDIR=/d" \
96 - -e "/^GIT_TR2_PARENT/d" \
96 + -e "/^GIT_TRACE2_PARENT/d" \
97 -e "/^GIT_/s/=.*//p" |
98 sort
99 EOF
t/t0210-trace2-normal.sh
+12 -12
@@ -4,9 +4,9 @@ test_description='test trace2 facility (normal target)'
4 . ./test-lib.sh
5
6 # Turn off any inherited trace2 settings for this test.
7 -sane_unset GIT_TR2 GIT_TR2_PERF GIT_TR2_EVENT
8 -sane_unset GIT_TR2_BRIEF
9 -sane_unset GIT_TR2_CONFIG_PARAMS
7 +sane_unset GIT_TRACE2 GIT_TRACE2_PERF GIT_TRACE2_EVENT
8 +sane_unset GIT_TRACE2_BRIEF
9 +sane_unset GIT_TRACE2_CONFIG_PARAMS
10
11 # Add t/helper directory to PATH so that we can use a relative
12 # 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 # to whatever filtering that target decides to do).
28 # This script tests the normal target in isolation.
29 #
30 -# Defer setting GIT_TR2 until the actual command line we want to test
30 +# Defer setting GIT_TRACE2 until the actual command line we want to test
31 # because hidden git and test-tool commands run by the test harness
32 # can contaminate our output.
33
34 # Enable "brief" feature which turns off "<clock> <file>:<line> " prefix.
35 -GIT_TR2_BRIEF=1 && export GIT_TR2_BRIEF
35 +GIT_TRACE2_BRIEF=1 && export GIT_TRACE2_BRIEF
36
37 # Basic tests of the trace2 normal stream. Since this stream is used
38 # primarily with printf-style debugging/tracing, we do limited testing
@@ -54,7 +54,7 @@ GIT_TR2_BRIEF=1 && export GIT_TR2_BRIEF
54
55 test_expect_success 'normal stream, return code 0' '
56 test_when_finished "rm trace.normal actual expect" &&
57 - GIT_TR2="$(pwd)/trace.normal" test-tool trace2 001return 0 &&
57 + GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 001return 0 &&
58 perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual &&
59 cat >expect <<-EOF &&
60 version $V
@@ -68,7 +68,7 @@ test_expect_success 'normal stream, return code 0' '
68
69 test_expect_success 'normal stream, return code 1' '
70 test_when_finished "rm trace.normal actual expect" &&
71 - test_must_fail env GIT_TR2="$(pwd)/trace.normal" test-tool trace2 001return 1 &&
71 + test_must_fail env GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 001return 1 &&
72 perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual &&
73 cat >expect <<-EOF &&
74 version $V
@@ -83,7 +83,7 @@ test_expect_success 'normal stream, return code 1' '
83 test_expect_success 'automatic filename' '
84 test_when_finished "rm -r traces actual expect" &&
85 mkdir traces &&
86 - GIT_TR2="$(pwd)/traces" test-tool trace2 001return 0 &&
86 + GIT_TRACE2="$(pwd)/traces" test-tool trace2 001return 0 &&
87 perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <"$(ls traces/*)" >actual &&
88 cat >expect <<-EOF &&
89 version $V
@@ -101,7 +101,7 @@ test_expect_success 'automatic filename' '
101
102 test_expect_success 'normal stream, exit code 0' '
103 test_when_finished "rm trace.normal actual expect" &&
104 - GIT_TR2="$(pwd)/trace.normal" test-tool trace2 002exit 0 &&
104 + GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 002exit 0 &&
105 perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual &&
106 cat >expect <<-EOF &&
107 version $V
@@ -115,7 +115,7 @@ test_expect_success 'normal stream, exit code 0' '
115
116 test_expect_success 'normal stream, exit code 1' '
117 test_when_finished "rm trace.normal actual expect" &&
118 - test_must_fail env GIT_TR2="$(pwd)/trace.normal" test-tool trace2 002exit 1 &&
118 + test_must_fail env GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 002exit 1 &&
119 perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual &&
120 cat >expect <<-EOF &&
121 version $V
@@ -133,7 +133,7 @@ test_expect_success 'normal stream, exit code 1' '
133
134 test_expect_success 'normal stream, error event' '
135 test_when_finished "rm trace.normal actual expect" &&
136 - GIT_TR2="$(pwd)/trace.normal" test-tool trace2 003error "hello world" "this is a test" &&
136 + GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 003error "hello world" "this is a test" &&
137 perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual &&
138 cat >expect <<-EOF &&
139 version $V
@@ -147,7 +147,7 @@ test_expect_success 'normal stream, error event' '
147 test_cmp expect actual
148 '
149
150 -sane_unset GIT_TR2_BRIEF
150 +sane_unset GIT_TRACE2_BRIEF
151
152 # Now test without environment variables and get all Trace2 settings
153 # from the global config.
t/t0211-trace2-perf.sh
+10 -10
@@ -4,9 +4,9 @@ test_description='test trace2 facility (perf target)'
4 . ./test-lib.sh
5
6 # Turn off any inherited trace2 settings for this test.
7 -sane_unset GIT_TR2 GIT_TR2_PERF GIT_TR2_EVENT
8 -sane_unset GIT_TR2_PERF_BRIEF
9 -sane_unset GIT_TR2_CONFIG_PARAMS
7 +sane_unset GIT_TRACE2 GIT_TRACE2_PERF GIT_TRACE2_EVENT
8 +sane_unset GIT_TRACE2_PERF_BRIEF
9 +sane_unset GIT_TRACE2_CONFIG_PARAMS
10
11 # Add t/helper directory to PATH so that we can use a relative
12 # 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 # to whatever filtering that target decides to do).
28 # Test each target independently.
29 #
30 -# Defer setting GIT_TR2_PERF until the actual command we want to
30 +# Defer setting GIT_TRACE2_PERF until the actual command we want to
31 # test because hidden git and test-tool commands in the test
32 # harness can contaminate our output.
33
34 # Enable "brief" feature which turns off the prefix:
35 # "<clock> <file>:<line> | <nr_parents> | "
36 -GIT_TR2_PERF_BRIEF=1 && export GIT_TR2_PERF_BRIEF
36 +GIT_TRACE2_PERF_BRIEF=1 && export GIT_TRACE2_PERF_BRIEF
37
38 # Repeat some of the t0210 tests using the perf target stream instead of
39 # the normal stream.
@@ -46,7 +46,7 @@ GIT_TR2_PERF_BRIEF=1 && export GIT_TR2_PERF_BRIEF
46
47 test_expect_success 'perf stream, return code 0' '
48 test_when_finished "rm trace.perf actual expect" &&
49 - GIT_TR2_PERF="$(pwd)/trace.perf" test-tool trace2 001return 0 &&
49 + GIT_TRACE2_PERF="$(pwd)/trace.perf" test-tool trace2 001return 0 &&
50 perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
51 cat >expect <<-EOF &&
52 d0|main|version|||||$V
@@ -60,7 +60,7 @@ test_expect_success 'perf stream, return code 0' '
60
61 test_expect_success 'perf stream, return code 1' '
62 test_when_finished "rm trace.perf actual expect" &&
63 - test_must_fail env GIT_TR2_PERF="$(pwd)/trace.perf" test-tool trace2 001return 1 &&
63 + test_must_fail env GIT_TRACE2_PERF="$(pwd)/trace.perf" test-tool trace2 001return 1 &&
64 perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
65 cat >expect <<-EOF &&
66 d0|main|version|||||$V
@@ -78,7 +78,7 @@ test_expect_success 'perf stream, return code 1' '
78
79 test_expect_success 'perf stream, error event' '
80 test_when_finished "rm trace.perf actual expect" &&
81 - GIT_TR2_PERF="$(pwd)/trace.perf" test-tool trace2 003error "hello world" "this is a test" &&
81 + GIT_TRACE2_PERF="$(pwd)/trace.perf" test-tool trace2 003error "hello world" "this is a test" &&
82 perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
83 cat >expect <<-EOF &&
84 d0|main|version|||||$V
@@ -124,7 +124,7 @@ test_expect_success 'perf stream, error event' '
124
125 test_expect_success 'perf stream, child processes' '
126 test_when_finished "rm trace.perf actual expect" &&
127 - GIT_TR2_PERF="$(pwd)/trace.perf" test-tool trace2 004child test-tool trace2 004child test-tool trace2 001return 0 &&
127 + GIT_TRACE2_PERF="$(pwd)/trace.perf" test-tool trace2 004child test-tool trace2 004child test-tool trace2 001return 0 &&
128 perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
129 cat >expect <<-EOF &&
130 d0|main|version|||||$V
@@ -150,7 +150,7 @@ test_expect_success 'perf stream, child processes' '
150 test_cmp expect actual
151 '
152
153 -sane_unset GIT_TR2_PERF_BRIEF
153 +sane_unset GIT_TRACE2_PERF_BRIEF
154
155 # Now test without environment variables and get all Trace2 settings
156 # from the global config.
t/t0212-trace2-event.sh
+8 -8
@@ -4,9 +4,9 @@ test_description='test trace2 facility'
4 . ./test-lib.sh
5
6 # Turn off any inherited trace2 settings for this test.
7 -sane_unset GIT_TR2 GIT_TR2_PERF GIT_TR2_EVENT
8 -sane_unset GIT_TR2_BARE
9 -sane_unset GIT_TR2_CONFIG_PARAMS
7 +sane_unset GIT_TRACE2 GIT_TRACE2_PERF GIT_TRACE2_EVENT
8 +sane_unset GIT_TRACE2_BARE
9 +sane_unset GIT_TRACE2_CONFIG_PARAMS
10
11 perl -MJSON::PP -e 0 >/dev/null 2>&1 && test_set_prereq JSON_PP
12
@@ -29,7 +29,7 @@ V=$(git version | sed -e 's/^git version //') && export V
29 # to whatever filtering that target decides to do).
30 # Test each target independently.
31 #
32 -# Defer setting GIT_TR2_PERF until the actual command we want to
32 +# Defer setting GIT_TRACE2_PERF until the actual command we want to
33 # test because hidden git and test-tool commands in the test
34 # harness can contaminate our output.
35
@@ -42,7 +42,7 @@ V=$(git version | sed -e 's/^git version //') && export V
42
43 test_expect_success JSON_PP 'event stream, error event' '
44 test_when_finished "rm trace.event actual expect" &&
45 - GIT_TR2_EVENT="$(pwd)/trace.event" test-tool trace2 003error "hello world" "this is a test" &&
45 + GIT_TRACE2_EVENT="$(pwd)/trace.event" test-tool trace2 003error "hello world" "this is a test" &&
46 perl "$TEST_DIRECTORY/t0212/parse_events.perl" <trace.event >actual &&
47 sed -e "s/^|//" >expect <<-EOF &&
48 |VAR1 = {
@@ -79,7 +79,7 @@ test_expect_success JSON_PP 'event stream, error event' '
79
80 test_expect_success JSON_PP 'event stream, return code 0' '
81 test_when_finished "rm trace.event actual expect" &&
82 - GIT_TR2_EVENT="$(pwd)/trace.event" test-tool trace2 004child test-tool trace2 004child test-tool trace2 001return 0 &&
82 + GIT_TRACE2_EVENT="$(pwd)/trace.event" test-tool trace2 004child test-tool trace2 004child test-tool trace2 001return 0 &&
83 perl "$TEST_DIRECTORY/t0212/parse_events.perl" <trace.event >actual &&
84 sed -e "s/^|//" >expect <<-EOF &&
85 |VAR1 = {
@@ -168,7 +168,7 @@ test_expect_success JSON_PP 'event stream, list config' '
168 test_when_finished "rm trace.event actual expect" &&
169 git config --local t0212.abc 1 &&
170 git config --local t0212.def "hello world" &&
171 - GIT_TR2_EVENT="$(pwd)/trace.event" GIT_TR2_CONFIG_PARAMS="t0212.*" test-tool trace2 001return 0 &&
171 + GIT_TRACE2_EVENT="$(pwd)/trace.event" GIT_TRACE2_CONFIG_PARAMS="t0212.*" test-tool trace2 001return 0 &&
172 perl "$TEST_DIRECTORY/t0212/parse_events.perl" <trace.event >actual &&
173 sed -e "s/^|//" >expect <<-EOF &&
174 |VAR1 = {
@@ -201,7 +201,7 @@ test_expect_success JSON_PP 'event stream, list config' '
201
202 test_expect_success JSON_PP 'basic trace2_data' '
203 test_when_finished "rm trace.event actual expect" &&
204 - GIT_TR2_EVENT="$(pwd)/trace.event" test-tool trace2 006data test_category k1 v1 test_category k2 v2 &&
204 + GIT_TRACE2_EVENT="$(pwd)/trace.event" test-tool trace2 006data test_category k1 v1 test_category k2 v2 &&
205 perl "$TEST_DIRECTORY/t0212/parse_events.perl" <trace.event >actual &&
206 sed -e "s/^|//" >expect <<-EOF &&
207 |VAR1 = {
t/t0212/parse_events.perl
+1 -1
@@ -26,7 +26,7 @@ use Getopt::Long;
26
27 # The version of the trace2 event target format that we understand.
28 # This is reported in the 'version' event in the 'evt' field.
29 -# It comes from the GIT_TR2_EVENT_VERSION macro in trace2/tr2_tgt_event.c
29 +# It comes from the GIT_TRACE2_EVENT_VERSION macro in trace2/tr2_tgt_event.c
30 my $evt_version = '1';
31
32 my $show_children = 1;
trace2.h
+1 -1
@@ -130,7 +130,7 @@ void trace2_cmd_alias_fl(const char *file, int line, const char *alias,
130 * list of patterns configured important. For example:
131 * git config --system trace2.configParams 'core.*,remote.*.url'
132 * or:
133 - * GIT_TR2_CONFIG_PARAMS=core.*,remote.*.url"
133 + * GIT_TRACE2_CONFIG_PARAMS=core.*,remote.*.url"
134 *
135 * Note: this routine does a read-only iteration on the config data
136 * (using read_early_config()), so it must not be called until enough
trace2/tr2_cmd_name.c
+1 -1
@@ -1,7 +1,7 @@
1 #include "cache.h"
2 #include "trace2/tr2_cmd_name.h"
3
4 -#define TR2_ENVVAR_PARENT_NAME "GIT_TR2_PARENT_NAME"
4 +#define TR2_ENVVAR_PARENT_NAME "GIT_TRACE2_PARENT_NAME"
5
6 static struct strbuf tr2cmdname_hierarchy = STRBUF_INIT;
7
trace2/tr2_sid.c
+1 -1
@@ -2,7 +2,7 @@
2 #include "trace2/tr2_tbuf.h"
3 #include "trace2/tr2_sid.h"
4
5 -#define TR2_ENVVAR_PARENT_SID "GIT_TR2_PARENT_SID"
5 +#define TR2_ENVVAR_PARENT_SID "GIT_TRACE2_PARENT_SID"
6
7 static struct strbuf tr2sid_buf = STRBUF_INIT;
8 static int tr2sid_nr_git_parents;
trace2/tr2_sysenv.c
+10 -10
@@ -21,33 +21,33 @@ struct tr2_sysenv_entry {
21 * The strings in this table are constant and must match the published
22 * config and environment variable names as described in the documentation.
23 *
24 - * We do not define entries for the GIT_TR2_PARENT_* environment
24 + * We do not define entries for the GIT_TRACE2_PARENT_* environment
25 * variables because they are transient and used to pass information
26 * from parent to child git processes, rather than settings.
27 */
28 /* clang-format off */
29 static struct tr2_sysenv_entry tr2_sysenv_settings[] = {
30 - [TR2_SYSENV_CFG_PARAM] = { "GIT_TR2_CONFIG_PARAMS",
30 + [TR2_SYSENV_CFG_PARAM] = { "GIT_TRACE2_CONFIG_PARAMS",
31 "trace2.configparams" },
32
33 - [TR2_SYSENV_DST_DEBUG] = { "GIT_TR2_DST_DEBUG",
33 + [TR2_SYSENV_DST_DEBUG] = { "GIT_TRACE2_DST_DEBUG",
34 "trace2.destinationdebug" },
35
36 - [TR2_SYSENV_NORMAL] = { "GIT_TR2",
36 + [TR2_SYSENV_NORMAL] = { "GIT_TRACE2",
37 "trace2.normaltarget" },
38 - [TR2_SYSENV_NORMAL_BRIEF] = { "GIT_TR2_BRIEF",
38 + [TR2_SYSENV_NORMAL_BRIEF] = { "GIT_TRACE2_BRIEF",
39 "trace2.normalbrief" },
40
41 - [TR2_SYSENV_EVENT] = { "GIT_TR2_EVENT",
41 + [TR2_SYSENV_EVENT] = { "GIT_TRACE2_EVENT",
42 "trace2.eventtarget" },
43 - [TR2_SYSENV_EVENT_BRIEF] = { "GIT_TR2_EVENT_BRIEF",
43 + [TR2_SYSENV_EVENT_BRIEF] = { "GIT_TRACE2_EVENT_BRIEF",
44 "trace2.eventbrief" },
45 - [TR2_SYSENV_EVENT_NESTING] = { "GIT_TR2_EVENT_NESTING",
45 + [TR2_SYSENV_EVENT_NESTING] = { "GIT_TRACE2_EVENT_NESTING",
46 "trace2.eventnesting" },
47
48 - [TR2_SYSENV_PERF] = { "GIT_TR2_PERF",
48 + [TR2_SYSENV_PERF] = { "GIT_TRACE2_PERF",
49 "trace2.perftarget" },
50 - [TR2_SYSENV_PERF_BRIEF] = { "GIT_TR2_PERF_BRIEF",
50 + [TR2_SYSENV_PERF_BRIEF] = { "GIT_TRACE2_PERF_BRIEF",
51 "trace2.perfbrief" },
52 };
53 /* clang-format on */
trace2/tr2_sysenv.h
+1 -1
@@ -7,7 +7,7 @@
7 *
8 * Note that this set does not contain any of the transient
9 * environment variables used to pass information from parent
10 - * to child git processes, such "GIT_TR2_PARENT_SID".
10 + * to child git processes, such "GIT_TRACE2_PARENT_SID".
11 */
12 enum tr2_sysenv_variable {
13 TR2_SYSENV_CFG_PARAM = 0,