Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use watchman_client #32

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nekowinston
Copy link

Closes #14.
I think I implemented the changes correctly, but I'm not 100% confident yet, thus marking it as WIP.
Just wanted to get the ball rolling on the issue.

@nekowinston
Copy link
Author

nekowinston commented Feb 4, 2025

I've been comparing the two outputs of the master branch and the PR branch with

export CLOCK=$(watchman clock . | jq -r .clock)
diff <(~/Code/rs-git-fsmonitor/target/release/rs-git-fsmonitor 2 "$CLOCK" | xxd) <(/nix/store/.../bin/rs-git-fsmonitor 2 "$CLOCK" | xxd)

and I'm pretty sure the output is correct.

Some notes:
If I understand resolve_root correctly, it uses the watch-project subcommand under the hood instead of the (deprecated) watch subcommand; which might lead to watchman watch-list differing to the current master branch.

Also, Connector::new will still spawn the underlying watchman CLI to figure out which watchman socket to use – I see a way better speedup compared to the master branch if I set WATCHMAN_SOCK as an environment variable.

@nekowinston nekowinston marked this pull request as ready for review February 4, 2025 15:15
nekowinston added a commit to nekowinston/dotfiles that referenced this pull request Feb 4, 2025
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.

Use watchman Rust client instead of subprocess
1 participant