Re: [PATCH v2 0/3] ls-files: reuse and update the untracked cache
- From
Tamir Duberstein <tamird@gmail.com>
- Date
- Oct 23, 2026, 02:13 UTC
- Message-ID
- <CAJ-ks9nTce-gU0xEMAXR8e18u+18RdRH3r2JH4ZignO+YDjq4Q@mail.gmail.com>
- In-Reply-To
- <20260923-ls-files-untracked-cache-v2-0-d7ee33476eb8@gmail.com>
On Wed, Sep 23, 2026 at 6:27 PM Tamir Duberstein <tamird@gmail.com> wrote:
Show 47 quoted lines
> > Repeated queries such as > > git ls-files --cached --others --exclude-standard -z -- "**/pyproject.toml" > > walk the working tree even when status has populated an untracked cache. > This series lets ls-files reuse those listings and save the work for later > commands through Git's existing optional index writes. > > The first patch fixes inconsistent ignore-file hashes that invalidate an > unchanged cache. The second lets 'git status -unormal' and > 'git status -uall' reuse the same cache. 'git status -unormal' still stops > scanning an untracked directory after finding an untracked file; a later > command requesting all untracked files completes the listing as needed. > The third lets ls-files use the cache and write pending untracked cache > and fsmonitor updates back to the index. --no-optional-locks suppresses > those writes. > > For wildcard pathspecs without a fixed prefix, apply the pathspec after > reading complete directory listings. A first query can therefore scan > directories that its pathspec would otherwise skip. Fixed-prefix, > attribute and exclude pathspecs retain their existing traversal. > > A new dir_flags value makes older versions of Git rebuild the cache before > using it to list untracked files. Changes invalidate cached entries in > parent directories as well, so updates can reopen more directories than > a cache populated with --untracked-files=all before this series. > > On macOS, with 100,000 files in 5,000 leaf directories, half tracked. > Each group of 100 leaf directories has 50 tracked and 50 untracked. > Each binary populated its own cache using the indicated status mode. > > hyperfine --warmup 3 --runs 7 (mean ± standard deviation, milliseconds): > > cache fsmonitor command upstream v1 v2 > normal off query 241.3 ± 14.8 132.7 ± 20.0 33.3 ± 2.4 > normal off query + status 292.7 ± 11.2 187.0 ± 10.8 92.6 ± 3.3 > all off query 231.3 ± 14.6 29.3 ± 1.3 34.7 ± 2.0 > normal on query 223.1 ± 17.8 111.0 ± 13.4 33.8 ± 1.5 > all on query 216.6 ± 12.0 28.0 ± 5.1 34.6 ± 0.8 > > "query" is the ls-files command above; "status" is > "git status -unormal --porcelain". These are repeated queries with warm > filesystem and untracked caches. > > Assisted-by: LLM > Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Hi folks, gentle nudge on this series.
Thanks. Tamir