From: "Alex Vandiver via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Nipunn Koorapati <nipunn1313@gmail.com>,
Alex Vandiver <alexmv@dropbox.com>
Subject: [PATCH 2/2] fsmonitor: make output of test-dump-fsmonitor more concise
Date: Wed, 21 Oct 2020 18:04:34 +0000 [thread overview]
Message-ID: <598521091a54caa73556b8bc9caf552d3216ba63.1603303474.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.767.git.1603303474.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
next prev parent reply other threads:[~2020-10-21 18:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-21 18:04 [PATCH 0/2] fsmonitor inline / testing cleanup Nipunn Koorapati via GitGitGadget
2020-10-21 18:04 ` [PATCH 1/2] fsmonitor: stop inline'ing mark_fsmonitor_valid / _invalid Alex Vandiver via GitGitGadget
2020-10-21 20:55 ` Taylor Blau
2020-10-21 21:24 ` Junio C Hamano
2020-10-21 21:31 ` Taylor Blau
2020-10-21 21:38 ` Junio C Hamano
2020-10-21 23:22 ` Nipunn Koorapati
2020-10-21 18:04 ` Alex Vandiver via GitGitGadget [this message]
2020-10-21 20:52 ` [PATCH 0/2] fsmonitor inline / testing cleanup Taylor Blau
2020-10-21 23:15 ` Nipunn Koorapati
2020-10-22 0:21 ` [PATCH v2 " Nipunn Koorapati via GitGitGadget
2020-10-22 0:21 ` [PATCH v2 1/2] fsmonitor: stop inline'ing mark_fsmonitor_valid / _invalid Alex Vandiver via GitGitGadget
2020-10-22 0:21 ` [PATCH v2 2/2] fsmonitor: make output of test-dump-fsmonitor more concise Alex Vandiver via GitGitGadget
2020-10-22 17:40 ` [PATCH v2 0/2] fsmonitor inline / testing cleanup Taylor Blau
2020-10-22 18:32 ` Junio C Hamano
2020-10-22 18:38 ` Taylor Blau
2020-10-22 19:14 ` Junio C Hamano
2020-10-22 20:59 ` Nipunn Koorapati
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=598521091a54caa73556b8bc9caf552d3216ba63.1603303474.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=alexmv@dropbox.com \
--cc=git@vger.kernel.org \
--cc=nipunn1313@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).