Repository navigation
Conversation
schacon
requested review from
Caleb-T-Owens,
davidpdrsn,
jonathantanmy2 and
krlvi
as code owners
November 2, 2026 20:31
Point gix and gix-testtools at schacon/gitoxide's gitbutler-fsmonitor branch: upstream 4dc73c31a, the rev we pinned before, plus two commits. The first commit makes gix status use Git's fsmonitor daemon and the untracked cache when core.fsmonitor is set: - It reads and writes the index's FSMN and UNTR extensions. - It asks `git fsmonitor--daemon` which paths changed since the token. - It skips stat checks for every other tracked entry. - It reuses cached directory listings for directories whose mtime has not changed. The second commit skips the daemon for indexes with fewer than 2000 entries, where its ~10 ms round trip costs more than a full scan. With the daemon running, on repositories with deep trees or about 100k files: status takes 64 ms instead of 342 ms, `show` 43 ms instead of 344 ms, `branch new` 200 ms instead of 1178 ms, and committing one file 177 ms instead of 792 ms. Small repositories measure the same. Output matched the upstream build for status after `branch new`, commit, uncommit, adding an untracked file, and deleting a branch. Go back to GitoxideLabs once this lands upstream.
libgit2's checkout_index rewrites the index without Git's FSMN and UNTR extensions. The next status then has no fsmonitor token and no untracked cache, so it scans the whole worktree again. On a deep repository that put a full scan after every `branch new`, `apply` and `unapply`. Before the checkout, keep the gix index if it has fsmonitor data. After the checkout, copy that data into the rewritten index with carry_over_fsmonitor_data_from() and write it. That function marks the paths the checkout changed as dirty, so they are still checked. It does nothing when fsmonitor is off.
update_workspace_commit used libgit2 to read the workspace tree into the index and write it. That write dropped the fsmonitor and untracked-cache extensions, and it reset the stat data of every entry. Every command that updates the workspace commit then forced a full worktree scan on the next status. gix now builds the index from the tree. Entries whose object id did not change keep their stat data and SKIP_WORKTREE flags, unless that stat data is racy. The new index carries over the fsmonitor data and is written. The libgit2 Repository then re-reads the index from disk, so callers that still hold it see the new index. Trade-off: Git's TREE (cache-tree) extension is no longer written. Only plain git's index-vs-HEAD comparison uses it, and git rebuilds it on its next commit.
schacon
force-pushed
the
gix-fsmonitor
branch
from
November 2, 2026 20:35
42bd383 to
54a3dbb
Compare
Collaborator
|
Especially those with bigger repos or those on Windows will have |
Collaborator
|
Please give me some days to review this: GitoxideLabs/gitoxide#3153 |
This branch has not been deployed
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.
🧢 Changes
gixandgix-testtoolspoint at schacon/gitoxidegitbutler-fsmonitor. That branch is the previously pinned upstream rev4dc73c31aplus two commits:git fsmonitor--daemonwhich paths changed and uses the index's untracked cache, whencore.fsmonitoris set.checkout_indexdrops the FSMN and UNTR index extensions. That forced a full worktree scan afterbranch new,applyandunapply. They are now carried into the rewritten index.update_workspace_commitrewrote the index with libgit2, which dropped the same extensions and reset stat data. gix now writes it, keeping stat data and sparse-checkout flags for unchanged entries.☕️ Reasoning
Report with charts and per-commit explanations: https://claude.ai/artifact/RuqYj5PkxTJkGRntXwWPTA
With the daemon running, compared with #16856 alone:
Trade-offs: