Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] JGit Protocol

2011/9/21 Nico Henglmueller <mailtonico@xxxxxxxxx>
Dear JGit-Devs,

I hope you're fine. I have got some questions about JGit and its
protocols. In the last few weeks I started reading "Pro Git" and I'm
still reading and learning. I want to use JGit in a distributed
environment. Example given:

It's a student - teacher architecture. For each student the teacher has
an own git repository and for every exercise there is a branch. The
student has his own repo and for every  new exercise I want to create a
new branch and check it out. I know that this doesn't fit to the Git
philosophy if you have a good idea let me know. To be up to date, the
teacher  fetches the repos of his students in a 30 sec. cycle. Another
way is that the students push their work to their repository to the
teacher, but the student would need write access on the teachers repo.
The branches (with the snapshots of the student's work) won't be merged
or rebased.

I saw that JGit implements HTTP/S, ssh+git and the git protocol. But I
don't want the user to set up git on his pc (it's a raw Java based
program). Is there a way for the teacher to  fetch the repositories from
his students without ssh, http/s or git access?

The concept is a JGit to JGit communication without git. Does an
implementation of this "protocol" exist?

My first idea was to implement a protocol by myself and extending the
already existing classes. The teacher just needs read access to the
students repos, so implementing my own protocol would do the trick.

Do you have any idea?

I hope you can help me!

JGit is a full-blown Java implementation of git so you should be able to use 
it on both sides of your communication channel without the need to also use
native git. Though as JGit implements the same protocols and data structures
as native git it should be fully interoperable with native git. It's even possible
to use both on the same repository concurrently.

A working example we use is to use Gerrit (using JGit internally) as a 
Git server and EGit (again relying on JGit's Java implementation of git)
on the developer's side. 

There is no need to use native git except if you need some advanced 
commands that are only available in native git and which JGit/EGit 
didn't yet implement.

You may use any of the protocols JGit supports (HTTP/S, ssh, git) 
to transfer data between both ends. So I think there is no need to invent 
yet another protocol. 

--
Matthias

Back to the top