diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-11-21 14:07:50 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-21 14:07:50 +0900 |
commit | e05336bddacb90cf243aacc0f7b7f34f900453d7 (patch) | |
tree | cb4a694c7de056ac7c4ec98e30b3b1c5b4cc3764 /preload-index.c | |
parent | f5da077b1f9e28a473f8219d8b8391450b794abf (diff) | |
parent | 614a718a797e04fb037b25371896f910e464b671 (diff) | |
download | git-e05336bddacb90cf243aacc0f7b7f34f900453d7.tar.gz git-e05336bddacb90cf243aacc0f7b7f34f900453d7.tar.xz |
Merge branch 'bp/fsmonitor'
We learned to talk to watchman to speed up "git status" and other
operations that need to see which paths have been modified.
* bp/fsmonitor:
fsmonitor: preserve utf8 filenames in fsmonitor-watchman log
fsmonitor: read entirety of watchman output
fsmonitor: MINGW support for watchman integration
fsmonitor: add a performance test
fsmonitor: add a sample integration script for Watchman
fsmonitor: add test cases for fsmonitor extension
split-index: disable the fsmonitor extension when running the split index test
fsmonitor: add a test tool to dump the index extension
update-index: add fsmonitor support to update-index
ls-files: Add support in ls-files to display the fsmonitor valid bit
fsmonitor: add documentation for the fsmonitor extension.
fsmonitor: teach git to optionally utilize a file system monitor to speed up detecting new or changed files.
update-index: add a new --force-write-index option
preload-index: add override to enable testing preload-index
bswap: add 64 bit endianness helper get_be64
Diffstat (limited to 'preload-index.c')
-rw-r--r-- | preload-index.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/preload-index.c b/preload-index.c index 70a4c8087..2a83255e4 100644 --- a/preload-index.c +++ b/preload-index.c @@ -4,6 +4,7 @@ #include "cache.h" #include "pathspec.h" #include "dir.h" +#include "fsmonitor.h" #ifdef NO_PTHREADS static void preload_index(struct index_state *index, @@ -55,15 +56,18 @@ static void *preload_thread(void *_data) continue; if (ce_skip_worktree(ce)) continue; + if (ce->ce_flags & CE_FSMONITOR_VALID) + continue; if (!ce_path_match(ce, &p->pathspec, NULL)) continue; if (threaded_has_symlink_leading_path(&cache, ce->name, ce_namelen(ce))) continue; if (lstat(ce->name, &st)) continue; - if (ie_match_stat(index, ce, &st, CE_MATCH_RACY_IS_DIRTY)) + if (ie_match_stat(index, ce, &st, CE_MATCH_RACY_IS_DIRTY|CE_MATCH_IGNORE_FSMONITOR)) continue; ce_mark_uptodate(ce); + mark_fsmonitor_valid(ce); } while (--nr > 0); cache_def_clear(&cache); return NULL; @@ -79,6 +83,8 @@ static void preload_index(struct index_state *index, return; threads = index->cache_nr / THREAD_COST; + if ((index->cache_nr > 1) && (threads < 2) && getenv("GIT_FORCE_PRELOAD_TEST")) + threads = 2; if (threads < 2) return; if (threads > MAX_PARALLEL) |