Filesystem Monitoring for Worktree Changes#5982
Closed
Byron wants to merge 1 commit intogitbutlerapp:masterfrom
Closed
Filesystem Monitoring for Worktree Changes#5982Byron wants to merge 1 commit intogitbutlerapp:masterfrom
Byron wants to merge 1 commit intogitbutlerapp:masterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
|
@Byron is attempting to deploy a commit to the GitButler Team on Vercel. A member of the Team first needs to authorize it. |
3 tasks
Collaborator
Author
|
Closing as this is something for much later. |
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.
This PR is about evaluating how to do portable and performance worktree tracking so that changes to the worktree can remain in sync with what's on Disk.
With such a system, keeping the app in sync with what's in disk will have higher performance than it could have if it would do a whole
git statuseach timesomething changes on disk.
Requirements
.gitchangesVerdict of Research
Even though one could spend time on making the builtin Git daemon usable so that we can…
…it won't actually do anything that our own file system watcher isn't doing already. Further, it won't give any paths that are inside the
.gitdirectory.I'd rather spend the time making our own filesystem monitor better (possibly after even by contributing fixes to the upstream project) than dealing with Gits monitoring daemon that we can't control nor patch easily.
Something we can certainly learn from is its event handling, it's well thought out and made for robustness.
Also there is always a variant of this 'subscription' system that needs to work without the monitor for network filesystems, so I don't think using Git fsmonitor saves any time (quite the opposite). Let's trust in Rust.
Tasks
git fsmonitorcli status -wto watch in the CLIResearch
git fsmonitor--daemon
Here are the docs.
git statustakes 600ms to ~900ms, without it it takes 2.8s. But it's far from instant.watchmanvariant, which is very portable, but also a memory hog. Also it's definitely not installed and an installation is isn't always easy as it contains C extensions.git statusoperation, and to speed up untracked files one needs to enable the untracked cache as well, at least for Git to make use of it fully.git statusor whatever client we know.fsmonitor.allowRemote=true.git/directory where the daemon is available, and that isn't supported on every filesystem the repository could be stored on. If that's the case, the socket is created in$HOME/git-fsmonitor-*or else the location offsmonitor.socketDiris used. Finding the right socket isn't entirely trivial but there are sources for that.fsmonitor_ipc__get_pathrefresh_fsmonitorcompat/fsmonitor/For later