git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 5/5] preload-index: update GIT_FORCE_PRELOAD_TEST support

From
Ben Peart <benpeart@microsoft.com>
Date
Sep 14, 2018, 20:14 UTC
Message-ID
<20180914201340.37400-6-benpeart@microsoft.com>
In-Reply-To
<20180914201340.37400-1-benpeart@microsoft.com>

Rename GIT_FORCE_PRELOAD_TEST to GIT_TEST_PRELOAD_INDEX 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.

Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
---
 preload-index.c             | 2 +-
 t/README                    | 3 +++
 t/t7519-status-fsmonitor.sh | 4 ++--
 t/test-lib.sh               | 1 +
 4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/preload-index.c b/preload-index.c
index 0a4e2933bb..a850e197c2 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -85,7 +85,7 @@ static void preload_index(struct index_state *index,
 		return;
 
 	threads = index->cache_nr / THREAD_COST;
-	if ((index->cache_nr > 1) && (threads < 2) && git_env_bool("GIT_FORCE_PRELOAD_TEST", 0))
+	if ((index->cache_nr > 1) && (threads < 2) && git_env_bool("GIT_TEST_PRELOAD_INDEX", 0))
 		threads = 2;
 	if (threads < 2)
 		return;
diff --git a/t/README b/t/README
index 9b13f6d12e..5670c7aad0 100644
--- a/t/README
+++ b/t/README
@@ -327,6 +327,9 @@ GIT_TEST_INDEX_VERSION=<n> exercises the index read/write code path
 for the index version specified.  Can be set to any valid version
 (currently 2, 3, or 4).
 
+GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path
+by overriding the minimum number of cache entries required per thread.
+
 Naming Tests
 ------------
 
diff --git a/t/t7519-status-fsmonitor.sh b/t/t7519-status-fsmonitor.sh
index d77012ea6d..8308d6d5b1 100755
--- a/t/t7519-status-fsmonitor.sh
+++ b/t/t7519-status-fsmonitor.sh
@@ -245,9 +245,9 @@ do
 		git config core.preloadIndex $preload_val &&
 		if test $preload_val = true
 		then
-			GIT_FORCE_PRELOAD_TEST=$preload_val; export GIT_FORCE_PRELOAD_TEST
+			GIT_TEST_PRELOAD_INDEX=$preload_val; export GIT_TEST_PRELOAD_INDEX
 		else
-			unset GIT_FORCE_PRELOAD_TEST
+			sane_unset GIT_TEST_PRELOAD_INDEX
 		fi
 	'
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 397eb71578..17a56f44ad 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -160,6 +160,7 @@ check_var_migration () {
 
 check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR
 check_var_migration TEST_GIT_INDEX_VERSION GIT_TEST_INDEX_VERSION
+check_var_migration GIT_FORCE_PRELOAD_TEST GIT_TEST_PRELOAD_INDEX
 
 # Add libc MALLOC and MALLOC_PERTURB test
 # only if we are not executing the test with valgrind
-- 
2.18.0.windows.1
Previous: Junio C HamanoNext: Ben Peart
Message 19 of 33 in “Cleanup pass on special test setups”
  1. 0/4 Cleanup pass on special test setupsBen Peart, Sep 14, 2018
  2. 1/4 correct typo/spelling error in t/READMEBen Peart, Sep 14, 2018
  3. 2/4 fsmonitor: update GIT_TEST_FSMONITOR supportBen Peart, Sep 14, 2018
  4. Junio C HamanoSep 14, 2018
  5. Junio C HamanoSep 14, 2018
  6. Junio C HamanoSep 14, 2018
  7. Ben PeartSep 14, 2018
  8. Junio C HamanoSep 14, 2018
  9. 0/5 Cleanup pass on special test setupsBen Peart, Sep 14, 2018
  10. 1/5 correct typo/spelling error in t/READMEBen Peart, Sep 14, 2018
  11. Jonathan NiederSep 14, 2018
  12. 2/5 preload-index: teach GIT_FORCE_PRELOAD_TEST to take a booleanBen Peart, Sep 14, 2018
  13. Jonathan NiederSep 14, 2018
  14. Junio C HamanoSep 14, 2018
  15. 3/5 fsmonitor: update GIT_TEST_FSMONITOR supportBen Peart, Sep 14, 2018
  16. 4/5 read-cache: update TEST_GIT_INDEX_VERSION supportBen Peart, Sep 14, 2018
  17. Junio C HamanoSep 14, 2018
  18. Junio C HamanoSep 14, 2018
  19. 5/5 preload-index: update GIT_FORCE_PRELOAD_TEST supportBen Peart, Sep 14, 2018
  20. 3/4 read-cache: update TEST_GIT_INDEX_VERSION supportBen Peart, Sep 14, 2018
  21. 4/4 preload-index: update GIT_FORCE_PRELOAD_TEST supportBen Peart, Sep 14, 2018
  22. 0/5 Cleanup pass on special test setupsBen Peart, Sep 18, 2018
  23. 1/5 t/README: correct spelling of "uncommon"Ben Peart, Sep 18, 2018
  24. 2/5 preload-index: use git_env_bool() not getenv() for customizationBen Peart, Sep 18, 2018
  25. 3/5 fsmonitor: update GIT_TEST_FSMONITOR supportBen Peart, Sep 18, 2018
  26. SZEDER GáborSep 28, 2018
  27. Ben PeartSep 28, 2018
  28. Ben PeartSep 28, 2018
  29. Junio C HamanoSep 28, 2018
  30. 4/5 read-cache: update TEST_GIT_INDEX_VERSION supportBen Peart, Sep 18, 2018
  31. 5/5 preload-index: update GIT_FORCE_PRELOAD_TEST supportBen Peart, Sep 18, 2018
  32. Re*: [PATCH v3 0/5] Cleanup pass on special test setupsJunio C Hamano, Sep 20, 2018
  33. Ben PeartSep 25, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.