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

[PATCH 2/3] In t7519, populate untracked cache before test

From
Tao Klerks via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 24, 2021, 18:30 UTC
Message-ID
<d63faad03a4bc41ea778bc4dd61c320e09424cd9.1624559402.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.986.git.1624559401.gitgitgadget@gmail.com>
From: Tao Klerks <tao@klerks.biz>

In its current state, the t7519 test dealing with untracked cache assumes that "git update-index --untracked-cache" will *populate* the untracked cache. This is not correct - it will only add an empty untracked cache structure to the index.

If we're going to compare two git status runs with something interesting happening in-between, we need to ensure that the index is in a stable/steady state *before* that first run.

We achieve this by adding another prior "git status" run.

At this stage this change does nothing, because there is a bug, addressed in the next patch. whereby once the empty untracked cache structure is added by the update-index invocation, the untracked cache gets updated in every subsequent "git status" call, but the index with these updates does not get written down.

That bug actually invalidates this entire test case - but we're fixing that next.

Signed-off-by: Tao Klerks <tao@klerks.biz>
---
 t/t7519-status-fsmonitor.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/t/t7519-status-fsmonitor.sh b/t/t7519-status-fsmonitor.sh
index 1209fa93499..ef75c548d90 100755
--- a/t/t7519-status-fsmonitor.sh
+++ b/t/t7519-status-fsmonitor.sh
@@ -339,6 +339,7 @@ test_expect_success UNTRACKED_CACHE 'ignore .git changes when invalidating UNTR'
 		avoid_racy &&
 		git update-index --untracked-cache &&
 		git update-index --fsmonitor &&
+		git status &&
 		GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace-before" \
 		git status &&
 		test-tool dump-untracked-cache >../before
-- 
gitgitgadget
Previous: Junio C HamanoNext: Tao Klerks via GitGitGadget
Message 4 of 19 in “Empty untracked cache performance issue”
  1. 0/3 Empty untracked cache performance issueTao Klerks via GitGitGadget, Jun 24, 2021
  2. 1/3 Add a second's delay to t7519 for untracked cacheTao Klerks via GitGitGadget, Jun 24, 2021
  3. Junio C HamanoJun 29, 2021
  4. 2/3 In t7519, populate untracked cache before testTao Klerks via GitGitGadget, Jun 24, 2021
  5. 3/3 Write index when populating empty untracked cacheTao Klerks via GitGitGadget, Jun 24, 2021
  6. Junio C HamanoJun 29, 2021
  7. Tao KlerksFeb 24, 2022
  8. Junio C HamanoFeb 24, 2022
  9. 0/3 Empty untracked cache performance issueTao Klerks via GitGitGadget, Feb 25, 2022
  10. 1/3 t7519: avoid file to index mtime race for untracked cacheTao Klerks via GitGitGadget, Feb 25, 2022
  11. Junio C HamanoFeb 25, 2022
  12. Tao KlerksFeb 27, 2022
  13. 2/3 t7519: populate untracked cache before testTao Klerks via GitGitGadget, Feb 25, 2022
  14. 3/3 untracked-cache: write index when populating empty untracked cacheTao Klerks via GitGitGadget, Feb 25, 2022
  15. Junio C HamanoFeb 25, 2022
  16. 0/3 Empty untracked cache performance issueTao Klerks via GitGitGadget, Feb 27, 2022
  17. 1/3 t7519: avoid file to index mtime race for untracked cacheTao Klerks via GitGitGadget, Feb 27, 2022
  18. 2/3 t7519: populate untracked cache before testTao Klerks via GitGitGadget, Feb 27, 2022
  19. 3/3 untracked-cache: write index when populating empty untracked cacheTao Klerks via GitGitGadget, Feb 27, 2022

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.