Replies: 5 comments 10 replies
-
Hi Alexis, it's good to hear from you here to talk about this exciting prospect. Gitoxide would definitely love to become part of Radicle and help getting there faster. As a matter of fact, the client connection code already knows Radicle, despite not being able to handle it yet or call handler programs that are configured elsewhere. The current task forecast is split into two parts. The first is all about generating packs and at least to some extend getting a server going. It is a direct consequence of @joshtriplett sponsorship and it's what I am (trying) to focus on. The other line of work was there originally and deals with all it takes to successfully clone a non-bare project. Nobody is working on this as far as I know. Continuing with 1) on the agenda, I suggest for someone familiar with Radicle's transitioning plan or needs to have a look at the current tasks forecast and see where there is intersection or where there are missing pieces. From there one might be able to construct a new tasks list which includes Radicle related priorities and work. It's certainly fine to add an entirely new train of work and we find overlaps together. As work is no fun if it doesn't get done, it might be worth looking into who can contribute or point 3) on the agenda. Me aside for the moment, @edward-shen comes to mind and I invite him to chime in as he sees fit. @avoidscorn as the contributor of the commitgraph crate should certainly be mentioned as well along with the cordial invitation to chime in as needed. As I myself am already set on a task I am much less available to focus on anything else, but will always take time to facilitate this project and help everyone involved to get desirable outcomes. I hope to reply here once a day and am looking forward to hearing your thoughts and findings. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Radicle core developer here.
To start off, let me be that guy and dial down the expectations a bit: there are
no immediate plans to move away from libgit2, and I doubt there will be any for
a long time to come.
I think we all agree that a git implementation in Rust would be a great addition
to the ecosystem, and if the Radicle Foundation can help pushing gitoxide --
both as an implementation and as a community -- forward towards that goal, that
would be great. Let's be real, however: there's a lot of work to be done until
then.
Alright, with that out of the way, I can elaborate a bit on why I wouldn't
depend on gitoxide any time soon, perhaps that can help framing the scope.
For Radicle, we basically have two kinds of uses for a git library:
1. Offline, read-mostly access to a normal git repo
That's for things like browsing the current tree, the history, refs, diffs,
etc. Maybe occasionally create a commit or a tag through a GUI. In short,
anything you'd expect from a non-CLI git client.
2. The peer-to-peer node ([radicle-link])
For 1. I think the only real nuisance of libgit2 are its C idiosyncracies (which
are, for a good part, git's idiosyncracies). I haven't exhaustively reviewed
gitoxide for the feature set we would need there, maybe it's on-par, maybe it's
not there yet. Either way, I see no pressure to move away from libgit2.
Naturally, I care more about 2.
There, the single biggest pain point has been to find ways to safely use
blocking code in an async/await context (and it's not pretty). However, that's
more a problem of async/await than of libgit2 in particular. It is certainly the
case that there are inefficiencies due to not being able to share repository
pointers between threads, and it's not always obvious without reviewing the
implementation which concurrent operations on a repository require external
synchronisation. This is an area where gitoxide could shine -- but I'd like to
point out that concurrent access to a repository needs to deal with concurrent
**processes**, some of which may be from a different implementation, so library
level concurrency primitives are only a fraction of the problem.
The second thing I'm worried about is the lack of protocol-v2 support in
libgit2. We only really need the "client" (that is, fetch) half, there's no
issue with running `git upload-pack` on the other side. There is potentially
some code in gitoxide which we could reuse, but a. we'll need to deal with the
async transport again, and b. we actually need more control over the sequence of
commands to run than what I can see is exposed.
Another big thing is the refdb. We're dealing with a (potentially large)
"monorepo", which will eventually accumulate A LOT of refs. There are large
projects which have outgrown packed-refs, and to address that the git community
has settled on introducing [reftable] as a scalable backend. For better or for
worse: implementing reftable comes at a considerable complexity cost, yet it has
all the properties I'd want (it's in many ways a "real" database). The point is,
the refdb needs to integrate with the rest of git, and as long as the repository
is not _exclusively_ accessed through a single implementation of git, every
implementation needs to do what git does. No, it's not in `next` yet, but I
believe @hanwen is actively working on it, and the latest version of the series
is only a few days old. I would expect that it is _much_ easier to port it over
to libgit2, than to implement a Rust version.
It is probably the case that we can also benefit from bitmap and multi-pack
indexes, but I'm not too concerned about that at the moment.
Fourth, the elephant: SHA-256. I don't yet understand all the implications of
this, but I'm very sure that it will be quite a mess as the plan is to support
both SHA-1 and SHA-256 for quite some time. Again, every implementation will
have to do what git does, and the hash algorithm basically touches everything.
Aside: until we can start using SHA-256, we rely on the implementation to use
"Hardened SHA-1". I'm not sure the `sha1` crate implements that.
Lastly, security. Obviously, the major implementations (git, libgit2, JGit)
receive more scrutiny, and CVEs tend to consider them. git doesn't have a
full-disclosure policy, so that's something to consider.
So yeah, looking at the tasks forecast, I'm not sure there's an awful lot of
overlap at the moment, unfortunately. I'll definitely try to get some
protocol-v2 going sometime soon-ish, and see if anything comes out of that which
would be worth contributing back. I'd love to hear your thoughts on the reftable
and hash algorithm topics.
[radicle-link]: https://github.com/radicle-dev/radicle-link
[reftable]: https://github.com/google/reftable
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the responses. I'll rephrase a bit: gitoxide does not currently fit the needs of the Radicle project. There are two ways to think about changing that:
I'm not at this point interested in 1., I don't know if @cloudhead is. If 2. is an option, our requirements are as follows (in this order):
Please let me know if this sounds interesting. Thanks, |
Beta Was this translation helpful? Give feedback.
-
by then more of Radicle's code will rely on Git2 which doesn't make using gitoxide that evolved without it in mind any easier.
Not necessarily: Radicle is envisioned as being composed of many applications, some of which will need “just git” functionality. radicle-link specifically, however, needs only a small fraction of the git surface, but access to plumbing functionality targeted towards “git on the server”-like usage patterns.
A big part of that is async/await. It’s okay to spawn_blocking until you need to re-enter the runtime from blocking code (because of network access) — and then it ripples through other parts of the system. As I don’t see the ecosystem moving away from async/await (much the opposite), anything which requires us to jump through such hoops again is not a net improvement. This is in conflict with early design decisions in gitoxide — if we’d try to fix our issues ourselves, that would be unlikely to be upstreamable, and vice versa. That’s the dilemma.
There is always a risk that I will do other jobs
Sorry, I had wrongly assumed that more specifics had been communicated before this thread was started. As you can guess from my laundry list, it's not going to get done by buying someone a coffee. On the contrary, there is enough stuff to keep someone busy full-time for a while, and that’s not something out of the question. Full-time can have different forms, and we can discuss what would suit. Whatever works will, however, have an impact on the direction of this project, or be its own effort. That’s how I see it 🤷
I agree that it might be best to let this sit for a while, and discuss specifics outside of this forum. If people following this want to get in touch, the email on my profile should work.
Thanks
|
Beta Was this translation helpful? Give feedback.
-
Servers generating packs would also be CPU bound
That's fair yes. I still think the protocol and transport crates would require
some substantial rework. I don't know what the best way is to deal with refdb
accesses, which we interleave with network calls. Technically, these need to be
spawned, but that seems like a context switch nightmare. We have to live with
this I guess, but you see where this is going?
|
Beta Was this translation helpful? Give feedback.
-
Hey there,
As discussed briefly with @Byron, the Radicle Foundation would be interested in helping fund the development of Gitoxide, with the hopes that Gitoxide could replace our usage of libgit2 down the line. Let's discuss the specifics here! There is another thread, though perhaps out-of-date, started by @FintanH here: #51, that could inspire this discussion.
What I'd like to figure out is:
Let's discuss!
Beta Was this translation helpful? Give feedback.
All reactions