feat: Use untracked cache when dir walking#2501
Closed
Aaron Moat (AaronMoat) wants to merge 1 commit intoGitoxideLabs:mainfrom
Closed
feat: Use untracked cache when dir walking#2501Aaron Moat (AaronMoat) wants to merge 1 commit intoGitoxideLabs:mainfrom
Aaron Moat (AaronMoat) wants to merge 1 commit intoGitoxideLabs:mainfrom
Conversation
df10a32 to
ce69c4f
Compare
gix-dir/src/walk/untracked_cache.rs
Outdated
| ..Default::default() | ||
| }; | ||
| if !expected.matches(&actual, opts) { | ||
| eprintln!( |
54e0907 to
9abae6a
Compare
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>
9abae6a to
24d6fdc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.