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

Untracked files cache not used when --untracked-files is used

From
DDDevste Devste <devstemail@gmail.com>
Date
Oct 3, 2025, 11:05 UTC
Message-ID
<CANM0SV3+4k5tsgRw0g8-HoVSFGb1AwZr+2hCUXLriFGSd33WQQ@mail.gmail.com>

I am using: git version 2.51.0.windows.1

Run: time git status --untracked-files

I get: It took 2.75 seconds to enumerate untracked files, but the results were cached, and subsequent runs may be faster. See 'git help status' for information on how to improve this.

real 0m2.959s user 0m0.000s sys 0m0.000s

---
when I run it again, I get the same thing again

However, when I run it again WITHOUT --untracked-files its much faster now: real 0m0.753s user 0m0.000s sys 0m0.015s

which means that the untracked cache does work (bc deleting the untracked cache, it will be slow and also show the message) per the docs:

>When -u option is not used, untracked files and directories are shown (i.e. the same as specifying normal)

Which I can confirm also with: git update-index --test-untracked-cache

>Testing mtime in 'C:/Foo/bar' ...... OK

It seems that using --untracked-files(=all) causes it to either not use the untracked files cache (or untracked files are not stored in the untracked files cache if they are in an untracked directory?) Since various tools and IDEs use that hardcoded, fixing this would be a massive performance boost for many users

Next: Matthew Hughes
Message 1 of 5 in “Untracked files cache not used when --untracked-files is used”
  1. Devste DevsteOct 3, 2025
  2. Matthew HughesOct 5, 2025
  3. Devste DevsteOct 5, 2025
  4. Matthew HughesOct 6, 2025
  5. Devste DevsteOct 7, 2025

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.