Implement git fsmonitor hook in Rust
- Dominant language
- C++
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Consider this as an RFC. I want to check the temperature prior to any implementation.
## Background
Most usages of watchman in the wild involve using it as the backend for git's fsmonitor hook on the client side.
However, the current example fsmonitor hook being shipped with git is written in Perl and shell out to `watchman -j` to run a query for changes. This has 2 problems: (1) high cold start of the Perl interpreter and (2) additional shell command subproccess overhead.
Some prior art such as https://github.com/jgavris/rs-git-fsmonitor has managed to solve (1) but not (2).
## Suggestion
In https://github.com/facebook/watchman/tree/main/watchman/rust create a new `git-fsmonitor-hook` binary depending on rust `watchman_client` to integrate with watchman process.
This binary should be optionally packaged together with watchman for opensource usages.
## Alternative
`git-fsmonitor-hook` could be a stand alone project that does not need to live in watchman's tree. But considering the dependency on watchman binary and the `watchman_client` rust lib, I think it makes more sense for the hook to live here, ideally with some tests to help preventing potential regressions.
Contributor guide
Assessment
This issue has not been assessed yet.