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

[PATCH v2 4/8] t3030-merge-recursive.sh: disable fsmonitor when tweaking GIT_WORK_TREE

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Dec 9, 2019, 16:10 UTC
Message-ID
<efc16962ee2595db50bf051fc84632b8c70036b3.1575907804.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.466.v2.git.1575907804.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>

The fsmonitor feature allows an external tool such as watchman to monitor the working directory. The direct test t7619-status-fsmonitor.sh provides some coverage, but it would be better to run the entire test suite with watchman enabled. This would provide more confidence that the feature is working as intended.

Worktrees use a ".git" _file_ instead of a folder to point to the base repo's .git directory and the proper worktree HEAD. The fsmonitor hook tries to create a JSON file inside the ".git" folder which violates the expectation here. It would be better to properly find a safe folder for storing this JSON file.

This is also a problem when a test script uses GIT_WORK_TREE.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 t/t1510-repo-setup.sh      | 1 +
 t/t2400-worktree-add.sh    | 2 ++
 t/t3030-merge-recursive.sh | 2 ++
 3 files changed, 5 insertions(+)
diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh
index 9974457f56..28dce0c26f 100755
--- a/t/t1510-repo-setup.sh
+++ b/t/t1510-repo-setup.sh
@@ -775,6 +775,7 @@ test_expect_success '#29: setup' '
 	setup_repo 29 non-existent gitfile true &&
 	mkdir -p 29/sub/sub 29/wt/sub &&
 	(
+		GIT_TEST_FSMONITOR="" &&
 		cd 29 &&
 		GIT_WORK_TREE="$here/29" &&
 		export GIT_WORK_TREE &&
diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh
index e819ba741e..d4d3cbae0f 100755
--- a/t/t2400-worktree-add.sh
+++ b/t/t2400-worktree-add.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+GIT_TEST_FSMONITOR=""
+
 test_description='test git worktree add'
 
 . ./test-lib.sh
diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index ff641b348a..62f645d639 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -520,6 +520,7 @@ test_expect_success 'reset and bind merge' '
 
 test_expect_success 'merge-recursive w/ empty work tree - ours has rename' '
 	(
+		GIT_TEST_FSMONITOR="" &&
 		GIT_WORK_TREE="$PWD/ours-has-rename-work" &&
 		export GIT_WORK_TREE &&
 		GIT_INDEX_FILE="$PWD/ours-has-rename-index" &&
@@ -545,6 +546,7 @@ test_expect_success 'merge-recursive w/ empty work tree - ours has rename' '
 
 test_expect_success 'merge-recursive w/ empty work tree - theirs has rename' '
 	(
+		GIT_TEST_FSMONITOR="" &&
 		GIT_WORK_TREE="$PWD/theirs-has-rename-work" &&
 		export GIT_WORK_TREE &&
 		GIT_INDEX_FILE="$PWD/theirs-has-rename-index" &&
-- 
gitgitgadget
Previous: SZEDER GáborNext: SZEDER Gábor
Message 25 of 41 in “Improve testability with GIT_TEST_FSMONITOR”
  1. 00/11 Improve testability with GIT_TEST_FSMONITORDerrick Stolee via GitGitGadget, Nov 21, 2019
  2. 01/11 fsmonitor: disable in a bare repoDerrick Stolee via GitGitGadget, Nov 21, 2019
  3. Denton LiuNov 21, 2019
  4. Derrick StoleeNov 22, 2019
  5. 02/11 fsmonitor: do not output to stderr for testsDerrick Stolee via GitGitGadget, Nov 21, 2019
  6. 03/11 t1301-shared-repo.sh: disable FSMONITORDerrick Stolee via GitGitGadget, Nov 21, 2019
  7. 04/11 t1510-repo-setup.sh: disable fsmonitor if no .git dirDerrick Stolee via GitGitGadget, Nov 21, 2019
  8. 05/11 fsmonitor: disable fsmonitor with worktreesDerrick Stolee via GitGitGadget, Nov 21, 2019
  9. 07/11 t3600-rm.sh: disable fsmonitor when deleting populated submoduleDerrick Stolee via GitGitGadget, Nov 21, 2019
  10. 06/11 t3030-merge-recursive.sh: disable fsmonitor when tweaking GIT_WORK_TREEDerrick Stolee via GitGitGadget, Nov 21, 2019
  11. 09/11 t7063: disable fsmonitor with status cacheDerrick Stolee via GitGitGadget, Nov 21, 2019
  12. 08/11 tests: disable fsmonitor in submodule testsDerrick Stolee via GitGitGadget, Nov 21, 2019
  13. 11/11 test-lib: clear watchman watches at test completionDerrick Stolee via GitGitGadget, Nov 21, 2019
  14. SZEDER GáborNov 22, 2019
  15. Derrick StoleeDec 9, 2019
  16. SZEDER GáborDec 9, 2019
  17. Derrick StoleeDec 10, 2019
  18. 10/11 t7519: disable external GIT_TEST_FSMONITOR variableDerrick Stolee via GitGitGadget, Nov 21, 2019
  19. 0/8 Improve testability with GIT_TEST_FSMONITORDerrick Stolee via GitGitGadget, Dec 9, 2019
  20. 1/8 fsmonitor: disable in a bare repoDerrick Stolee via GitGitGadget, Dec 9, 2019
  21. SZEDER GáborDec 10, 2019
  22. 2/8 fsmonitor: do not output to stderr for testsDerrick Stolee via GitGitGadget, Dec 9, 2019
  23. 3/8 t1301-shared-repo.sh: disable FSMONITORDerrick Stolee via GitGitGadget, Dec 9, 2019
  24. SZEDER GáborDec 10, 2019
  25. 4/8 t3030-merge-recursive.sh: disable fsmonitor when tweaking GIT_WORK_TREEDerrick Stolee via GitGitGadget, Dec 9, 2019
  26. SZEDER GáborDec 10, 2019
  27. Derrick StoleeDec 10, 2019
  28. SZEDER GáborDec 10, 2019
  29. SZEDER GáborDec 10, 2019
  30. Derrick StoleeJan 23, 2020
  31. 7/8 t7519: disable external GIT_TEST_FSMONITOR variableDerrick Stolee via GitGitGadget, Dec 9, 2019
  32. 8/8 test-lib: clear watchman watches at test completionDerrick Stolee via GitGitGadget, Dec 9, 2019
  33. Junio C HamanoDec 9, 2019
  34. Derrick StoleeDec 10, 2019
  35. Junio C HamanoDec 10, 2019
  36. Derrick StoleeDec 10, 2019
  37. Johannes SchindelinDec 10, 2019
  38. 6/8 t7063: disable fsmonitor with status cacheDerrick Stolee via GitGitGadget, Dec 9, 2019
  39. 5/8 tests: disable fsmonitor in submodule testsDerrick Stolee via GitGitGadget, Dec 9, 2019
  40. SZEDER GáborDec 10, 2019
  41. Derrick StoleeDec 10, 2019

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.