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

[PATCH v2 2/2] fsmonitor: make output of test-dump-fsmonitor more concise

From
Alex Vandiver via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 22, 2020, 00:21 UTC
Message-ID
<8ff657ded147f23e9db96c21205771e09dac9dca.1603326066.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.767.v2.git.1603326066.gitgitgadget@gmail.com>
From: Alex Vandiver <alexmv@dropbox.com>

After displaying one very long line, summarize the contents of that line. The tests do not currently rely on any content except the first line ("no fsmonitor" / "fsmonitor last update").

Signed-off-by: Alex Vandiver <alexmv@dropbox.com>
Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com>
---
 t/helper/test-dump-fsmonitor.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/t/helper/test-dump-fsmonitor.c b/t/helper/test-dump-fsmonitor.c
index 975f0ac890..a42e402bf8 100644
--- a/t/helper/test-dump-fsmonitor.c
+++ b/t/helper/test-dump-fsmonitor.c
@@ -4,7 +4,7 @@
 int cmd__dump_fsmonitor(int ac, const char **av)
 {
 	struct index_state *istate = the_repository->index;
-	int i;
+	int i, valid = 0;
 
 	setup_git_directory();
 	if (do_read_index(istate, the_repository->index_file, 0) < 0)
@@ -15,8 +15,18 @@ int cmd__dump_fsmonitor(int ac, const char **av)
 	}
 	printf("fsmonitor last update %s\n", istate->fsmonitor_last_update);
 
-	for (i = 0; i < istate->cache_nr; i++)
+	for (i = 0; i < istate->cache_nr; i++) {
 		printf((istate->cache[i]->ce_flags & CE_FSMONITOR_VALID) ? "+" : "-");
+		if (istate->cache[i]->ce_flags & CE_FSMONITOR_VALID)
+			valid++;
+	}
+
+	printf("\n  valid:   %d\n", valid);
+	printf("  invalid: %d\n", istate->cache_nr - valid);
+
+	for (i = 0; i < istate->cache_nr; i++)
+		if (!(istate->cache[i]->ce_flags & CE_FSMONITOR_VALID))
+			printf("   - %s\n", istate->cache[i]->name);
 
 	return 0;
 }
-- 
gitgitgadget
Previous: Nipunn Koorapati via GitGitGadgetNext: Alex Vandiver via GitGitGadget
Message 12 of 18 in “fsmonitor inline / testing cleanup”
  1. 0/2 fsmonitor inline / testing cleanupNipunn Koorapati via GitGitGadget, Oct 21, 2020
  2. 2/2 fsmonitor: make output of test-dump-fsmonitor more conciseAlex Vandiver via GitGitGadget, Oct 21, 2020
  3. 1/2 fsmonitor: stop inline'ing mark_fsmonitor_valid / _invalidAlex Vandiver via GitGitGadget, Oct 21, 2020
  4. Taylor BlauOct 21, 2020
  5. Junio C HamanoOct 21, 2020
  6. Taylor BlauOct 21, 2020
  7. Junio C HamanoOct 21, 2020
  8. Nipunn KoorapatiOct 21, 2020
  9. Taylor BlauOct 21, 2020
  10. Nipunn KoorapatiOct 21, 2020
  11. 0/2 fsmonitor inline / testing cleanupNipunn Koorapati via GitGitGadget, Oct 22, 2020
  12. 2/2 fsmonitor: make output of test-dump-fsmonitor more conciseAlex Vandiver via GitGitGadget, Oct 22, 2020
  13. 1/2 fsmonitor: stop inline'ing mark_fsmonitor_valid / _invalidAlex Vandiver via GitGitGadget, Oct 22, 2020
  14. Taylor BlauOct 22, 2020
  15. Junio C HamanoOct 22, 2020
  16. Taylor BlauOct 22, 2020
  17. Junio C HamanoOct 22, 2020
  18. Nipunn KoorapatiOct 22, 2020

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.