From: Ben Peart <benpeart@microsoft.com>
To: git@vger.kernel.org, gitster@pobox.com, alexmv@dropbox.com,
avarab@gmail.com, johannes.schindelin@gmx.de
Cc: Ben Peart <benpeart@microsoft.com>
Subject: [PATCH v1] fsmonitor: force index write after full scan
Date: Tue, 10 Apr 2018 14:14:31 -0400 [thread overview]
Message-ID: <20180410181431.21024-1-benpeart@microsoft.com> (raw)
fsmonitor currently only flags the index as dirty if the extension is being
added or removed. This is a performance optimization that recognizes you can
stat() a lot of files in less time than it takes to write out an updated index.
This patch makes a small enhancement and flags the index dirty if we end up
having to stat() all files and scan the entire working directory. The assumption
being that must be expensive or you would not have turned on the feature.
Signed-off-by: Ben Peart <benpeart@microsoft.com>
---
Notes:
Base Ref:
Web-Diff: https://github.com/benpeart/git/commit/4d39ddc2f9
Checkout: git fetch https://github.com/benpeart/git fsmonitor-perf-v1 && git checkout 4d39ddc2f9
fsmonitor.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fsmonitor.c b/fsmonitor.c
index eb4e642256..ed3d1a074d 100644
--- a/fsmonitor.c
+++ b/fsmonitor.c
@@ -185,6 +185,9 @@ void refresh_fsmonitor(struct index_state *istate)
for (i = 0; i < istate->cache_nr; i++)
istate->cache[i]->ce_flags &= ~CE_FSMONITOR_VALID;
+ /* If we're going to check every file, ensure we save the results */
+ istate->cache_changed |= FSMONITOR_CHANGED;
+
if (istate->untracked)
istate->untracked->use_fsmonitor = 0;
}
base-commit: 0ac4dfac5000ef8de7966a3b7229275567d2d707
--
2.17.0.windows.1
reply other threads:[~2018-04-10 18:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180410181431.21024-1-benpeart@microsoft.com \
--to=benpeart@microsoft.com \
--cc=alexmv@dropbox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
/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.
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 NNTP newsgroup(s).