-
Notifications
You must be signed in to change notification settings - Fork 324
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
FR: Switch to gitoxide backend instead of libgit2 for the backend #2316
Comments
I suspect it would be easy to switch to gitoxide for reading and writing commits etc. I actually doubt it would have significant impact on performance. It's probably going to be harder to replace libgit2 by gitoxide for some of the other git integration (push/pull, importing/exporting refs). |
@martinvonz I mean it claims to be faster so hopefully it is, plus a slow rollout to gitoxide seems like a good idea, replacing libgit2 slowly between versions :3 |
One advantage of Gitoxide, performance or not, is that pure rust code is vastly easier to build and vendor in stranger circumstances; it may even unblock #1997 for instance, which is pretty badly held up on the need for libopenssl-sys to be compiled (which in turn is a dependency of libgit2-rs) |
My gut feeling is that gitoxide aims to be more transparent than libgit2. We'll need to know more about the underlying Git data model. Random comments on gix API: * gix::Repository provides API similar to git2::Repository, but has less "convenient" functions. For example, we need to use .find_object() + .try_to/into_<kind>() instead of .find_<kind>(). * gix::Object, Blob, etc. own raw data as bytes. gix::object and gix::objs types provide high-level views on such data. * Tree building is pretty low-level compared to git2. * gix leverages bstr (i.e. bytes) extensively. It's probably not difficult to migrate git::import/export_refs(). It might help eliminate the startup overhead of libssl initialization. The gix-based GitBackend appears to be a bit faster, but that wouldn't practically matter. martinvonz#2316
My gut feeling is that gitoxide aims to be more transparent than libgit2. We'll need to know more about the underlying Git data model. Random comments on gix API: * gix::Repository provides API similar to git2::Repository, but has less "convenient" functions. For example, we need to use .find_object() + .try_to/into_<kind>() instead of .find_<kind>(). * gix::Object, Blob, etc. own raw data as bytes. gix::object and gix::objs types provide high-level views on such data. * Tree building is pretty low-level compared to git2. * gix leverages bstr (i.e. bytes) extensively. It's probably not difficult to migrate git::import/export_refs(). It might help eliminate the startup overhead of libssl initialization. The gix-based GitBackend appears to be a bit faster, but that wouldn't practically matter. martinvonz#2316
My gut feeling is that gitoxide aims to be more transparent than libgit2. We'll need to know more about the underlying Git data model. Random comments on gix API: * gix::Repository provides API similar to git2::Repository, but has less "convenient" functions. For example, we need to use .find_object() + .try_to/into_<kind>() instead of .find_<kind>(). * gix::Object, Blob, etc. own raw data as bytes. gix::object and gix::objs types provide high-level views on such data. * Tree building is pretty low-level compared to git2. * gix leverages bstr (i.e. bytes) extensively. It's probably not difficult to migrate git::import/export_refs(). It might help eliminate the startup overhead of libssl initialization. The gix-based GitBackend appears to be a bit faster, but that wouldn't practically matter. martinvonz#2316
My gut feeling is that gitoxide aims to be more transparent than libgit2. We'll need to know more about the underlying Git data model. Random comments on gix API: * gix::Repository provides API similar to git2::Repository, but has less "convenient" functions. For example, we need to use .find_object() + .try_to/into_<kind>() instead of .find_<kind>(). * gix::Object, Blob, etc. own raw data as bytes. gix::object and gix::objs types provide high-level views on such data. * Tree building is pretty low-level compared to git2. * gix leverages bstr (i.e. bytes) extensively. It's probably not difficult to migrate git::import/export_refs(). It might help eliminate the startup overhead of libssl initialization. The gix-based GitBackend appears to be a bit faster, but that wouldn't practically matter. #2316
What's the status on this being possible? |
It's partially done. Most local operations use Gitoxide, but we haven't started using it for push/pull yet mostly because Gitoxide doesn't support push. |
Is your feature request related to a problem? Please describe.
This is obviously a longer term feature request but it would be extremely nice to have a faster implementation of git implemented in jj instead of the current libgit2 backend, the biggest advantages to switching would be performance and the memory safety of the top of my head.
Describe the solution you'd like
Gradual transition to gitoxide as the default backend instead of libgit2
Describe alternatives you've considered
Keep using libgit2
Additional context
gitoxide is dual licensed with MIT and Apache 2.0, making it compatible with this project.
The text was updated successfully, but these errors were encountered: