fsmonitor: update GIT_TEST_FSMONITOR support
Rename GIT_FSMONITOR_TEST to GIT_TEST_FSMONITOR for consistency with the other GIT_TEST_ special setups and properly document its use. Add logic in t/test-lib.sh to give a warning when the old variable is set to let people know they need to update their environment to use the new variable. Remove the outdated instructions on how to run the test suite utilizing fsmonitor now that it is properly documented in t/README. Signed-off-by: Ben Peart <Ben.Peart@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ben Peart committed
Sep 18, 2018 at 23:29 UTC
4cb54d0aa8e2b8de6f6bafd5c2baad0db5ce9dc7
5 files changed
+26
-9
config.c
+1
-1
@@ -2278,7 +2278,7 @@ int git_config_get_max_percent_split_change(void)
2278
int git_config_get_fsmonitor(void)
2279
{
2280
if (git_config_get_pathname("core.fsmonitor", &core_fsmonitor))
2281
- core_fsmonitor = getenv("GIT_FSMONITOR_TEST");
2281
+ core_fsmonitor = getenv("GIT_TEST_FSMONITOR");
2282
2283
if (core_fsmonitor && !*core_fsmonitor)
2284
core_fsmonitor = NULL;
t/README
+4
@@ -319,6 +319,10 @@ GIT_TEST_OE_DELTA_SIZE=<n> exercises the uncommon pack-objects code
319
path where deltas larger than this limit require extra memory
320
allocation for bookkeeping.
321
322
+GIT_TEST_FSMONITOR=$PWD/t7519/fsmonitor-all exercises the fsmonitor
323
+code path for utilizing a file system monitor to speed up detecting
324
+new or changed files.
325
+
326
Naming Tests
327
------------
328
t/t1700-split-index.sh
+1
-1
@@ -6,7 +6,7 @@ test_description='split index mode tests'
6
7
# We need total control of index splitting here
8
sane_unset GIT_TEST_SPLIT_INDEX
9
-sane_unset GIT_FSMONITOR_TEST
9
+sane_unset GIT_TEST_FSMONITOR
10
11
test_expect_success 'enable split index' '
12
git config splitIndex.maxPercentChange 100 &&
t/t7519-status-fsmonitor.sh
-7
@@ -4,13 +4,6 @@ test_description='git status with file system watcher'
4
5
. ./test-lib.sh
6
7
-#
8
-# To run the entire git test suite using fsmonitor:
9
-#
10
-# copy t/t7519/fsmonitor-all to a location in your path and then set
11
-# GIT_FSMONITOR_TEST=fsmonitor-all and run your tests.
12
-#
13
-
7
# Note, after "git reset --hard HEAD" no extensions exist other than 'TREE'
8
# "git update-index --fsmonitor" can be used to get the extension written
9
# before testing the results.
t/test-lib.sh
+20
@@ -140,6 +140,26 @@ then
140
export GIT_INDEX_VERSION
141
fi
142
143
+check_var_migration () {
144
+ old_name=$1 new_name=$2
145
+ eval "old_isset=\${${old_name}:+isset}"
146
+ eval "new_isset=\${${new_name}:+isset}"
147
+ case "$old_isset,$new_isset" in
148
+ isset,)
149
+ echo >&2 "warning: $old_name is now $new_name"
150
+ echo >&2 "hint: set $new_name too during the transition period"
151
+ eval "$new_name=\$$old_name"
152
+ ;;
153
+ isset,isset)
154
+ # do this later
155
+ # echo >&2 "warning: $old_name is now $new_name"
156
+ # echo >&2 "hint: remove $old_name"
157
+ ;;
158
+ esac
159
+}
160
+
161
+check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR
162
+
163
# Add libc MALLOC and MALLOC_PERTURB test
164
# only if we are not executing the test with valgrind
165
if expr " $GIT_TEST_OPTS " : ".* --valgrind " >/dev/null ||