21

Which code and how much code do the original Git codebase and libgit2 have in common (from nothing to all Git functionality except of command line client entry points)?

I'm primarily interested in how "stable" libgit2 is and how easily and quickly bug-fixes and/or improvements from future development in the original Git codebase can be adopted by libgit2.

2 Answers 2

16

I believe currently they share no code. You might be interested in this thread on the main Git list¹ regarding a prospective "reimplementing" Git on top of libgit2 — with main Git maintainer (Junio C Hamano) chiming in.

In general, you might find these search results² interesting to inspect.


¹ The original link was pointing at GMANE's archive, but it's unfortunately down.

² The link to search results was this.

9
  • 3
    It's true that core git does not use libgit2, however there is core git code in libgit2; a number of authors have allowed their code (from git) to be relicensed under the libgit2 license (GPLv2 with a linking exception.) Commented Jun 17, 2013 at 19:14
  • @EdwardThomson as a very coarse estimate: would you say that libgit2 is based on core git code or that it's more or less a rewrite from scratch?
    – mstrap
    Commented Jun 17, 2013 at 21:37
  • 4
    It's a rewrite. I haven't run a similarity metric to get real data, but I'd say less than 10% of the libgit2 code is ported from or copied directly from git.
    – Ben Straub
    Commented Jun 17, 2013 at 22:40
  • 1
    @mstrap, while Git itself does not (currently) use libgit2, a number of other projects do: "Github for Windows" uses it (and supposedly "Github for Mac" does this as well), libgit2sharp is beleived to be the standard way to use Git from C# etc. So while it's not a "blessed" way to access Git repositories, it appears to be rather popular and has all the good chances to gain the necessary momentum IMO.
    – kostix
    Commented Jun 18, 2013 at 9:48
  • @BenStraub I think this is the answer I'm looking for.
    – mstrap
    Commented Jun 18, 2013 at 12:37
7

It currently shares no code and...

According to Russell Belfer:

When will core git be rewritten on top of libgit2...the answer is never. We serve different masters...

He lists some details to why in the talk that the quote was taken from: https://www.youtube.com/watch?v=4ZWqr6iih3s

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.