Skip to content

feat: Use untracked cache when dir walking#2501

Closed
Aaron Moat (AaronMoat) wants to merge 1 commit intoGitoxideLabs:mainfrom
AaronMoat:use-untracked-cache
Closed

feat: Use untracked cache when dir walking#2501
Aaron Moat (AaronMoat) wants to merge 1 commit intoGitoxideLabs:mainfrom
AaronMoat:use-untracked-cache

Conversation

@AaronMoat
Copy link
Copy Markdown

No description provided.

@AaronMoat Aaron Moat (AaronMoat) force-pushed the use-untracked-cache branch 6 times, most recently from df10a32 to ce69c4f Compare April 3, 2026 23:18
..Default::default()
};
if !expected.matches(&actual, opts) {
eprintln!(
@AaronMoat Aaron Moat (AaronMoat) force-pushed the use-untracked-cache branch 9 times, most recently from 54e0907 to 9abae6a Compare April 4, 2026 03:47
When `core.untrackedCache` is true (or overridden via the new
`dirwalk::UntrackedCache` option), `gix-dir` now consults the index
`UNTR` extension before reading each directory from disk. Directories
whose stat and exclude-file OID still match the cache are served
entirely from memory, avoiding `read_dir` syscalls for unchanged trees.

The implementation validates the cache before use: it checks the
worktree identifier, the ignore-stack source and exclude filename, and
the global excludes-file stat. Per-directory validation checks the
stored mtime and, when present, the `.gitignore` blob OID.

Also fixes a long-standing swap of the `ctime`/`mtime` fields in
`gix-index`'s stat decoder: the binary format stores ctime first then
mtime, but the fields were assigned to the opposite struct members.
This had no visible effect for regular index entries (where ctime ≈ mtime
at write time) but caused IOUC stat comparisons to fail for directories
whose ctime and mtime differ.

Co-authored-by: GPT 5.4 <codex@openai.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants