Working on an all-Elixir implementation of git -- looking for co-contributors

Hi, I had the idea a few months ago that an all-Elixir implementation of git could be an interesting foundation for some future projects I’d like to build and also an interesting way to deeply learn the internals of git.

I’ve started this project as a port from jgit and have a fair amount of the core infrastructure ported. It’s far from ready for prime time, but I’m sharing this now in hopes of finding co-conspirators for this project.

If you are interested in contributing, the project – such as it is at the moment – is available as xgit on GitHub. Please reach out to me here or on GitHub.

Thanks!

-Eric

13 Likes

Thanks a lot :smiley:

This is according to the quote in the readme a pretty important implementation.

Do you know ocaml-git? Since I assume it is closer to your implementation as jgit is, so it could help you as an example.

1 Like

No, I was not familiar with ocaml-git. Good to know, though I’m far enough into it that it would be hard to switch gears now.

1 Like

There is also erlangit. Though, this has not been touched in almost ten years. You may already be further along than it was.

2 Likes

From the erlangit README:

It is currently slower than a slow-motion replay of a cold-weather molasses drip-race judged by sloths who just took Nyquil. Slowly.

:rofl:

11 Likes

Nice, but one suggestion:

Split that library and at first implement only libgit2 functionalities instead of whole CLI UI. It is more important to be able to work with the repo itself programmatically rather than using particular CLI commands (and that will be much easier to work that way).

12 Likes

Yes, definitely this!

3 Likes

Split that library and at first implement only libgit2 functionalities instead of whole CLI UI.

This was essentially my goal, but apparently not stated clearly enough.

FWIW I’ve spoken privately with one of the lead authors of jgit and had a similar response: Given my stated goal of creating something that can be used for a git server and not a local workstation git client, time spent working on working tree operations (and likewise, any concurrent interop on disk with command-line git or jgit) is essentially wasted.

As I have time, I’ll be redirecting the project in that direction.

Thank you all for your feedback.

6 Likes

Totally not what you asked for, but can I see if you are aware (or might like to work with):

https://github.com/almightycouch/gitgud

1 Like

I posted a couple months ago about my effort to build an all-Elixir implementation of git. Based on some feedback and some further experiences in the porting effort, I’ve shifted gears to fully focus on building a server-native, Elixir-native git implementation.

More on the new effort and how I got to that point: https://xgit.io/burning-down-the-house/

4 Likes

More on Xgit’s progress: Xgit Reflog: All the World’s a (git) Stage.

Looking for advice on a couple of Erlang/OTP design issues: One is Xgit specific (how to manage a potentially large volume of data across process boundaries). Another is more tied to zlib, so I’ll post that in a separate thread.

Also: If you’ve followed this project on GitHub, your watches and follows appear to have followed the archiving of the previous jgit-based project. If you are still interested, please re-follow the current Xgit project.

3 Likes

Xgit continues to make progress. Currently working through the git fundamentals (lately: commit objects and references): https://xgit.io/reference-implementation/

4 Likes

This is great! I started something similar, because I wanted to clone and monitor repositories. I quickly realized that the scope was way to big for the MVP/prototype I was building. So I put it off into the future.

This makes me want to pick up where I left off. If I do pick it up I’ll definitely want to help out on this!

1 Like

i see that this project has been abandoned but I believe that it’s very important to have a a native implementation of git in the elixir space. If you can provide any resources on implementing git, i’d pick up this project.

Why? Beside making some software that heavily uses git functionality, what is the actual usage?

If you want to invest the time and effort, I would suggest to take it one step further and create a new spec that will fix all the shortcomings of the current git, namely things like rebasing that are actual implementation limitations that a end-user should not care about.

that’s the exact usage i am trying to implement. i’m creating a piece of software that heavily relies on git functionality and other tools and i believe it’ll be cleaner to use a native library. Right now I’m contemplating on just calling the git commands directly using System.cmd but overtime i’d like to have a cleaner and more straight forward solution implemented.

Implementing everything from scratch seems to be a huge time and effort investment, instead you could implement the bindings between elixir and something like libgit2, much easier and better performance(if done right).

1 Like