-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add Git support #934
Add Git support #934
Conversation
Hi @arxanas! Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours needs attention. You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
@wez pls fix build? I just want a macOS executable with these changes 🥺🙏 . |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@fanzeyi has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
1 similar comment
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@facebook-github-bot You're welcome! |
@mroch Thanks for cleaning this up and merging! And thanks @chadaustin for reviewing! |
This looks exciting! What does one need to do to an existing git repo monitored by the fsmonitor hook to take advantage of this new integration? |
https://facebook.github.io/watchman/docs/scm-query.html is the main feature that this integration most immediately unlocks. @arxanas @mroch: looks like those docs could do with being updated to mention the new new |
My reading of #934 (comment) was that it would also improve performance. Do I misunderstand? |
@wez / @mroch I'm happy to update documentation, but I think that the current implementation is buggy. I had difficulty updating the tests in the OSS build. I tried @dmose This functionality could be used to improve performance, but it needs to be adopted by tools which plan to make specific use of it. It also probably won't be too useful unless your repository is big enough. I'm curious how large your repository is? I personally plan to update https://github.com/arxanas/git-branchless to use it for commit/status/diff operations one day. As per this comment, I think there is room for improvement:
To go over the points in my original comment:
|
It's quite large: https://github.com/mozilla/gecko-dev (it contains all of firefox desktop and gecko, which includes codebases like webrtc, spidermonkey, lots of vendored-in rust etc). I guess I was imagining a world where git itself used this interface instead of the fs-notify hook to speed up normal operations (git status, etc). I'm now suspecting that someone would have to sign up to do that work on the git side. Is that correct? |
The changes in this PR allow watchman to reason about git state by calling out to git and caching information. To speed up the git fsmonitor integration, the logical first step would be to eliminate that python process overhead mentioned above by eg: rewriting that hook in say Rust using the watchman_client crate. My recollection is that fsmonitor only accelerates a subset of git compared to the deeper integration in the Mercurial fsmonitor extension. I believe that it may be technically possible to more deeply integrate the fsmonitor concept in git, but the architecture of git likely makes that a fairly high effort engineering project. |
@dmose I do performance testing for https://github.com/arxanas/git-branchless on You can add yourself as a watcher to the repository and get notified when I publish a release that adds a replacement for You might also want to try the If you also have the problem of an fsmonitor hook with slow startup, you might be able to try https://github.com/jgavris/rs-git-fsmonitor. This isn't an option for me, unfortunately. You could also try developing on |
Git SCM support has been added since 2021.08.30 release via a pull request by @arxanas. (1) Update website documentation to reflect that Git support has been added additionally to Mercurial. (1): facebook#934
Summary: Git SCM support has been added since 2021.08.30 release via a pull request by arxanas. (1) Update website documentation to reflect that Git support has been added additionally to Mercurial. (1): #934 Pull Request resolved: #1036 Reviewed By: genevievehelsel Differential Revision: D37215628 Pulled By: chadaustin fbshipit-source-id: 2bcef730bcccf976e9c98c7d728985e07078c941
Git already supports Watchman via the
fsmonitor
hook. For performance reasons, I want to add Git support directly: