Skip to content

Commit 4cb54d0

Browse files
benpeartgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5aacc63 commit 4cb54d0

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2278,7 +2278,7 @@ int git_config_get_max_percent_split_change(void)
22782278
int git_config_get_fsmonitor(void)
22792279
{
22802280
if (git_config_get_pathname("core.fsmonitor", &core_fsmonitor))
2281-
core_fsmonitor = getenv("GIT_FSMONITOR_TEST");
2281+
core_fsmonitor = getenv("GIT_TEST_FSMONITOR");
22822282

22832283
if (core_fsmonitor && !*core_fsmonitor)
22842284
core_fsmonitor = NULL;

t/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ GIT_TEST_OE_DELTA_SIZE=<n> exercises the uncommon pack-objects code
319319
path where deltas larger than this limit require extra memory
320320
allocation for bookkeeping.
321321

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+
322326
Naming Tests
323327
------------
324328

t/t1700-split-index.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_description='split index mode tests'
66

77
# We need total control of index splitting here
88
sane_unset GIT_TEST_SPLIT_INDEX
9-
sane_unset GIT_FSMONITOR_TEST
9+
sane_unset GIT_TEST_FSMONITOR
1010

1111
test_expect_success 'enable split index' '
1212
git config splitIndex.maxPercentChange 100 &&

t/t7519-status-fsmonitor.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ test_description='git status with file system watcher'
44

55
. ./test-lib.sh
66

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-
147
# Note, after "git reset --hard HEAD" no extensions exist other than 'TREE'
158
# "git update-index --fsmonitor" can be used to get the extension written
169
# before testing the results.

t/test-lib.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,26 @@ then
140140
export GIT_INDEX_VERSION
141141
fi
142142

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+
143163
# Add libc MALLOC and MALLOC_PERTURB test
144164
# only if we are not executing the test with valgrind
145165
if expr " $GIT_TEST_OPTS " : ".* --valgrind " >/dev/null ||

0 commit comments

Comments
 (0)