Subject: Re: Using both JGit and C Git

From: "Shawn O. Pearce" <[email-masked]>
Date: Mon, 10 Aug 2009 08:12:55 -0700

Semen Vadishev <[email-masked]> wrote:
> I'm working on git client written in Java. Now the application uses both
> implementations but our team is interested in switching to JGit
> completely some day. We consider that for the first version all
> read-only operations should be implemented with JGit and read-write
> functionality should use exec calls to git executable. We would keep
> that approach until we have even the smallest suspect that pure Java
> implementation could corrupt repository somehow. Also we have a number
> of read-write operations implemented with JGit and we will use them
> internally to collect more experience and to see if any problems will
> appear.
> 
> Does anyone here already have any experience with using both JGit and C
> Git together. Is there any kind of test suites which allow to check
> JGit's behavior on different platforms comparing with native git. Is
> there any known issues/workarounds? Any feedback is much appreciated.
> 
> I've noticed that such a question was raised here, but the answers are
> probably out of date now.

There are some tests in the JGit test suite that validate JGit
against C Git output to ensure the data is the same.  For example
we have created certain content with C Git, checked a copy of the
pack file into the JGit repository, then create the same content
in JGit and validate that the data is the same.  But this sort of
test is difficult because of potential unimportant variations in
the zlib library.  The compressed output can safely differ, when
running the output through the inflate method the original content
is still restored.  So we tend not to rely on it that much.

I can say that JGit completely powers Gerrit Code Review[1], and
that Gerrit Code Review is in use at many different sites as a
production server, relied upon by thousands for their daily work.
As a case in point, Gerrit Code Review powers the Android Open
Source Project... and also the Android related teams for many device
manufacturers who are building devices running that operating system.
It also powers the servers used by the Google developers who work
on Android.

Gerrit Code Review completely runs the server side portion of Git,
both the git-upload-pack and git-receive-pack, in a pure Java SSHD.
Its the only interface the teams have to their repository... and
it does it quite nicely.  The users don't know the difference,
it just works.

So, in my humble opinion, as a server technology, JGit is quite
stable and works well.  It doesn't perform as well as C Git does,
especially under high user loads, but we aren't serving volume here
as a public read-only mirror, we are supporting a smaller group.

[1] http://code.google.com/p/gerrit/

-- 
Shawn.