Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2019-05-19 17:43:08 +0300
committerJunio C Hamano <gitster@pobox.com>2019-05-28 20:20:34 +0300
commite4b75d6a1d3105958c307e526ae6759e86f7f837 (patch)
tree99d0e0963cce62b29fafbe5795ce187b211d25d3 /t
parentaa25c82427ae70aebf3b8f970f2afd54e9a2a8c6 (diff)
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t0001-init.sh2
-rwxr-xr-xt/t0210-trace2-normal.sh24
-rwxr-xr-xt/t0211-trace2-perf.sh20
-rwxr-xr-xt/t0212-trace2-event.sh16
-rw-r--r--t/t0212/parse_events.perl2
5 files changed, 32 insertions, 32 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 1f462204ea..77a224aafb 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -93,7 +93,7 @@ test_expect_success 'No extra GIT_* on alias scripts' '
sed -n \
-e "/^GIT_PREFIX=/d" \
-e "/^GIT_TEXTDOMAINDIR=/d" \
- -e "/^GIT_TR2_PARENT/d" \
+ -e "/^GIT_TRACE2_PARENT/d" \
-e "/^GIT_/s/=.*//p" |
sort
EOF
diff --git a/t/t0210-trace2-normal.sh b/t/t0210-trace2-normal.sh
index 71194a3623..ce7574edb1 100755
--- a/t/t0210-trace2-normal.sh
+++ b/t/t0210-trace2-normal.sh
@@ -4,9 +4,9 @@ test_description='test trace2 facility (normal target)'
. ./test-lib.sh
# Turn off any inherited trace2 settings for this test.
-sane_unset GIT_TR2 GIT_TR2_PERF GIT_TR2_EVENT
-sane_unset GIT_TR2_BRIEF
-sane_unset GIT_TR2_CONFIG_PARAMS
+sane_unset GIT_TRACE2 GIT_TRACE2_PERF GIT_TRACE2_EVENT
+sane_unset GIT_TRACE2_BRIEF
+sane_unset GIT_TRACE2_CONFIG_PARAMS
# 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
# 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
@@ -54,7 +54,7 @@ GIT_TR2_BRIEF=1 && export GIT_TR2_BRIEF
test_expect_success 'normal stream, return code 0' '
test_when_finished "rm trace.normal actual expect" &&
- GIT_TR2="$(pwd)/trace.normal" test-tool trace2 001return 0 &&
+ GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 001return 0 &&
perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual &&
cat >expect <<-EOF &&
version $V
@@ -68,7 +68,7 @@ test_expect_success 'normal stream, return code 0' '
test_expect_success 'normal stream, return code 1' '
test_when_finished "rm trace.normal actual expect" &&
- test_must_fail env GIT_TR2="$(pwd)/trace.normal" test-tool trace2 001return 1 &&
+ test_must_fail env GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 001return 1 &&
perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual &&
cat >expect <<-EOF &&
version $V
@@ -83,7 +83,7 @@ test_expect_success 'normal stream, return code 1' '
test_expect_success 'automatic filename' '
test_when_finished "rm -r traces actual expect" &&
mkdir traces &&
- GIT_TR2="$(pwd)/traces" test-tool trace2 001return 0 &&
+ GIT_TRACE2="$(pwd)/traces" test-tool trace2 001return 0 &&
perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <"$(ls traces/*)" >actual &&
cat >expect <<-EOF &&
version $V
@@ -101,7 +101,7 @@ test_expect_success 'automatic filename' '
test_expect_success 'normal stream, exit code 0' '
test_when_finished "rm trace.normal actual expect" &&
- GIT_TR2="$(pwd)/trace.normal" test-tool trace2 002exit 0 &&
+ GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 002exit 0 &&
perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual &&
cat >expect <<-EOF &&
version $V
@@ -115,7 +115,7 @@ test_expect_success 'normal stream, exit code 0' '
test_expect_success 'normal stream, exit code 1' '
test_when_finished "rm trace.normal actual expect" &&
- test_must_fail env GIT_TR2="$(pwd)/trace.normal" test-tool trace2 002exit 1 &&
+ test_must_fail env GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 002exit 1 &&
perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual &&
cat >expect <<-EOF &&
version $V
@@ -133,7 +133,7 @@ test_expect_success 'normal stream, exit code 1' '
test_expect_success 'normal stream, error event' '
test_when_finished "rm trace.normal actual expect" &&
- GIT_TR2="$(pwd)/trace.normal" test-tool trace2 003error "hello world" "this is a test" &&
+ GIT_TRACE2="$(pwd)/trace.normal" test-tool trace2 003error "hello world" "this is a test" &&
perl "$TEST_DIRECTORY/t0210/scrub_normal.perl" <trace.normal >actual &&
cat >expect <<-EOF &&
version $V
@@ -147,7 +147,7 @@ test_expect_success 'normal stream, error event' '
test_cmp expect actual
'
-sane_unset GIT_TR2_BRIEF
+sane_unset GIT_TRACE2_BRIEF
# Now test without environment variables and get all Trace2 settings
# from the global config.
diff --git a/t/t0211-trace2-perf.sh b/t/t0211-trace2-perf.sh
index b501e867af..2c3ad6e8c1 100755
--- a/t/t0211-trace2-perf.sh
+++ b/t/t0211-trace2-perf.sh
@@ -4,9 +4,9 @@ test_description='test trace2 facility (perf target)'
. ./test-lib.sh
# Turn off any inherited trace2 settings for this test.
-sane_unset GIT_TR2 GIT_TR2_PERF GIT_TR2_EVENT
-sane_unset GIT_TR2_PERF_BRIEF
-sane_unset GIT_TR2_CONFIG_PARAMS
+sane_unset GIT_TRACE2 GIT_TRACE2_PERF GIT_TRACE2_EVENT
+sane_unset GIT_TRACE2_PERF_BRIEF
+sane_unset GIT_TRACE2_CONFIG_PARAMS
# 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
# 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:
# "<clock> <file>:<line> | <nr_parents> | "
-GIT_TR2_PERF_BRIEF=1 && export GIT_TR2_PERF_BRIEF
+GIT_TRACE2_PERF_BRIEF=1 && export GIT_TRACE2_PERF_BRIEF
# Repeat some of the t0210 tests using the perf target stream instead of
# the normal stream.
@@ -46,7 +46,7 @@ GIT_TR2_PERF_BRIEF=1 && export GIT_TR2_PERF_BRIEF
test_expect_success 'perf stream, return code 0' '
test_when_finished "rm trace.perf actual expect" &&
- GIT_TR2_PERF="$(pwd)/trace.perf" test-tool trace2 001return 0 &&
+ GIT_TRACE2_PERF="$(pwd)/trace.perf" test-tool trace2 001return 0 &&
perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
cat >expect <<-EOF &&
d0|main|version|||||$V
@@ -60,7 +60,7 @@ test_expect_success 'perf stream, return code 0' '
test_expect_success 'perf stream, return code 1' '
test_when_finished "rm trace.perf actual expect" &&
- test_must_fail env GIT_TR2_PERF="$(pwd)/trace.perf" test-tool trace2 001return 1 &&
+ test_must_fail env GIT_TRACE2_PERF="$(pwd)/trace.perf" test-tool trace2 001return 1 &&
perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
cat >expect <<-EOF &&
d0|main|version|||||$V
@@ -78,7 +78,7 @@ test_expect_success 'perf stream, return code 1' '
test_expect_success 'perf stream, error event' '
test_when_finished "rm trace.perf actual expect" &&
- GIT_TR2_PERF="$(pwd)/trace.perf" test-tool trace2 003error "hello world" "this is a test" &&
+ GIT_TRACE2_PERF="$(pwd)/trace.perf" test-tool trace2 003error "hello world" "this is a test" &&
perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
cat >expect <<-EOF &&
d0|main|version|||||$V
@@ -124,7 +124,7 @@ test_expect_success 'perf stream, error event' '
test_expect_success 'perf stream, child processes' '
test_when_finished "rm trace.perf actual expect" &&
- GIT_TR2_PERF="$(pwd)/trace.perf" test-tool trace2 004child test-tool trace2 004child test-tool trace2 001return 0 &&
+ GIT_TRACE2_PERF="$(pwd)/trace.perf" test-tool trace2 004child test-tool trace2 004child test-tool trace2 001return 0 &&
perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <trace.perf >actual &&
cat >expect <<-EOF &&
d0|main|version|||||$V
@@ -150,7 +150,7 @@ test_expect_success 'perf stream, child processes' '
test_cmp expect actual
'
-sane_unset GIT_TR2_PERF_BRIEF
+sane_unset GIT_TRACE2_PERF_BRIEF
# Now test without environment variables and get all Trace2 settings
# from the global config.
diff --git a/t/t0212-trace2-event.sh b/t/t0212-trace2-event.sh
index 59adae8123..ff5b9cc729 100755
--- a/t/t0212-trace2-event.sh
+++ b/t/t0212-trace2-event.sh
@@ -4,9 +4,9 @@ test_description='test trace2 facility'
. ./test-lib.sh
# Turn off any inherited trace2 settings for this test.
-sane_unset GIT_TR2 GIT_TR2_PERF GIT_TR2_EVENT
-sane_unset GIT_TR2_BARE
-sane_unset GIT_TR2_CONFIG_PARAMS
+sane_unset GIT_TRACE2 GIT_TRACE2_PERF GIT_TRACE2_EVENT
+sane_unset GIT_TRACE2_BARE
+sane_unset GIT_TRACE2_CONFIG_PARAMS
perl -MJSON::PP -e 0 >/dev/null 2>&1 && test_set_prereq JSON_PP
@@ -29,7 +29,7 @@ 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.
@@ -42,7 +42,7 @@ V=$(git version | sed -e 's/^git version //') && export V
test_expect_success JSON_PP 'event stream, error event' '
test_when_finished "rm trace.event actual expect" &&
- GIT_TR2_EVENT="$(pwd)/trace.event" test-tool trace2 003error "hello world" "this is a test" &&
+ GIT_TRACE2_EVENT="$(pwd)/trace.event" test-tool trace2 003error "hello world" "this is a test" &&
perl "$TEST_DIRECTORY/t0212/parse_events.perl" <trace.event >actual &&
sed -e "s/^|//" >expect <<-EOF &&
|VAR1 = {
@@ -79,7 +79,7 @@ test_expect_success JSON_PP 'event stream, error event' '
test_expect_success JSON_PP 'event stream, return code 0' '
test_when_finished "rm trace.event actual expect" &&
- GIT_TR2_EVENT="$(pwd)/trace.event" test-tool trace2 004child test-tool trace2 004child test-tool trace2 001return 0 &&
+ GIT_TRACE2_EVENT="$(pwd)/trace.event" test-tool trace2 004child test-tool trace2 004child test-tool trace2 001return 0 &&
perl "$TEST_DIRECTORY/t0212/parse_events.perl" <trace.event >actual &&
sed -e "s/^|//" >expect <<-EOF &&
|VAR1 = {
@@ -168,7 +168,7 @@ test_expect_success JSON_PP 'event stream, list config' '
test_when_finished "rm trace.event actual expect" &&
git config --local t0212.abc 1 &&
git config --local t0212.def "hello world" &&
- GIT_TR2_EVENT="$(pwd)/trace.event" GIT_TR2_CONFIG_PARAMS="t0212.*" test-tool trace2 001return 0 &&
+ GIT_TRACE2_EVENT="$(pwd)/trace.event" GIT_TRACE2_CONFIG_PARAMS="t0212.*" test-tool trace2 001return 0 &&
perl "$TEST_DIRECTORY/t0212/parse_events.perl" <trace.event >actual &&
sed -e "s/^|//" >expect <<-EOF &&
|VAR1 = {
@@ -201,7 +201,7 @@ test_expect_success JSON_PP 'event stream, list config' '
test_expect_success JSON_PP 'basic trace2_data' '
test_when_finished "rm trace.event actual expect" &&
- GIT_TR2_EVENT="$(pwd)/trace.event" test-tool trace2 006data test_category k1 v1 test_category k2 v2 &&
+ GIT_TRACE2_EVENT="$(pwd)/trace.event" test-tool trace2 006data test_category k1 v1 test_category k2 v2 &&
perl "$TEST_DIRECTORY/t0212/parse_events.perl" <trace.event >actual &&
sed -e "s/^|//" >expect <<-EOF &&
|VAR1 = {
diff --git a/t/t0212/parse_events.perl b/t/t0212/parse_events.perl
index a2776ba216..6584bb5634 100644
--- a/t/t0212/parse_events.perl
+++ b/t/t0212/parse_events.perl
@@ -26,7 +26,7 @@ use Getopt::Long;
# The version of the trace2 event target format that we understand.
# This is reported in the 'version' event in the 'evt' field.
-# It comes from the GIT_TR2_EVENT_VERSION macro in trace2/tr2_tgt_event.c
+# It comes from the GIT_TRACE2_EVENT_VERSION macro in trace2/tr2_tgt_event.c
my $evt_version = '1';
my $show_children = 1;