Skip to content

Tracking Issue for git2 deprecation #5548

Open
@bsdinis

Description

There has been a latent sentiment amongst contributors that jj has outgrown its need to depend on libgit2, and as such we are moving to replace it and eventually deprecate it. This issue tracks the reasoning for this move, as well as the steps needed to make it happen and a deprecation plan.

Steps

Rationale

Issues with git2

libgit2 (with git2 being its Rust bindings) is a project to implement git as a library so that external applications can interact programmatically with git repos without having to shell out to git and parse its output.

This effort is commendable and git2 has been crucial in making jj git compatible from the get go. I'd like to emphasize that this is by now means a bash on libgit2. However, we have found some pain points with its usage:

  • Missing support for SSH. This regularly comes up when users try to push to Github, with over 20 issues opened about it for jj plus multiple reports a week.
  • Packaging problems. libgit2 only supports one version at a time, meaning packagers have a problematic window of time while jj has not updated the git2 to its latest version
  • Performance. For the main (current) usage of libgit2, which is interacting with git remotes, libgit2 has been reported to be slow

Change to what

jj actually uses another git library to interact with repositories: gitoxide. This means that, as it stands, we have two libraries for interacting with git, which is arguably one too many.
As gitoxide has become more feature complete, relying on git2 becomes less desirable.
For the remaining cases (which turn out to be simply the push/fetch operations), the consensus is to rely on shelling out to a git subprocess.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions