git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How can i write a new protocol for git

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 5, 2008, 14:52 UTC
Message-ID
<20080905145246.GA20537@spearce.org>
In-Reply-To
<20080905094746.GA26820@glandium.org>
Mike Hommey <mh@glandium.org> wrote:
Show 7 quoted lines
> On Fri, Sep 05, 2008 at 05:22:57PM +0800, Sky Patrick wrote:
> > 
> > If i want to write a new protocol for file transfer and would like to
> > to integrate it with git. Is it possible and easy to integrate it ?
> > Currently, i know that jgit may achieve it, but it is a Java
> > implementation and may not work with git command line program that
> > written in C.
Writing a dumb protocol support isn't difficult in JGit due to the
abstractions in place.  Its a little harder in C Git, unless Mike
(or someone else) can abstract out the cURL library usage and make
it more flexible.  Though these days cURL supports just about any
file transfer protocol known.
 
> First, it would depend if you need this new protocol to be a dumb
> protocol (like rsync and http) or "native" (git or ssh).

Writing a smart protocol is a PITA. Look at the smart HTTP effort I am trying to do. OK, I'm not spending a whole lot of time on it, but its a damn difficult thing to do well, and to keep simple enough that it can be described and reimplemented. Otherwise we have another that-thing-before-Git on our hands.

> I've been meaning to refactor the dumb protocol "stack" for a while, but
> haven't gone much further than ideas in my mind (i.e. no code). I also
> have some start of http code recfactoring, that is waiting for this dumb
> protocol rework to be completed.

Yea. One reason why I'm doing the smart HTTP effort prototype in JGit is because the C code structure makes this harder to implement without first going through a number of refactorings. Though for the smart HTTP stuff I really need to refactor fetch-pack/send-pack and upload-pack/receive-pack, not the dumb walkers.

-- 
Shawn.
Previous: Mike HommeyNext: Sky Patrick
Message 4 of 5 in “How can i write a new protocol for git”
  1. Sky PatrickSep 5, 2008
  2. Jakub NarebskiSep 5, 2008
  3. Mike HommeySep 5, 2008
  4. Shawn O. PearceSep 5, 2008
  5. Sky PatrickSep 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.