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

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

Previous: Tamir DubersteinNext: Tamir Duberstein
Message 9 of 13 in “ls-files: reuse the untracked cache”
  1. 0/2 ls-files: reuse the untracked cacheTamir Duberstein, Sep 23, 2026
  2. 1/2 dir: hash ignore files before adding parser LFTamir Duberstein, Sep 23, 2026
  3. 2/2 ls-files: reuse cached untracked listingsTamir Duberstein, Sep 23, 2026
  4. Tamir DubersteinSep 23, 2026
  5. 0/3 ls-files: reuse and update the untracked cacheTamir Duberstein, Sep 23, 2026
  6. 1/3 dir: hash ignore files before appending newlineTamir Duberstein, Sep 23, 2026
  7. 2/3 dir: share untracked caches across output modesTamir Duberstein, Sep 23, 2026
  8. 3/3 ls-files: use and update the untracked cacheTamir Duberstein, Sep 23, 2026
  9. Tamir DubersteinOct 23, 2026
  10. 0/3 ls-files: reuse and update the untracked cacheTamir Duberstein, Oct 23, 2026
  11. 1/3 dir: hash ignore files before appending newlineTamir Duberstein, Oct 23, 2026
  12. 2/3 dir: share untracked caches across output modesTamir Duberstein, Oct 23, 2026
  13. 3/3 ls-files: use and update the untracked cacheTamir Duberstein, Oct 23, 2026

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.