git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git protocol specification
@ 2008-07-09 18:23 Tom Werner
  2008-07-09 18:45 ` Johannes Schindelin
  2008-07-10  2:32 ` Shawn O. Pearce
  0 siblings, 2 replies; 4+ messages in thread
From: Tom Werner @ 2008-07-09 18:23 UTC (permalink / raw)
  To: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 437 bytes --]

I'm working on a flexible Erlang replacement for git-daemon and would 
like to know if there is a specification available for the protocol that 
git-upload-pack and git-receive-pack use. I've reverse engineered it but 
have come across some points that seem inconsistent. Before I dig into 
the C code in earnest I wanted to see if there's anything like spec 
document for the system. Thanks!

-- 
Tom Preston-Werner
github.com/mojombo


[-- Attachment #2: pubsub.vcf --]
[-- Type: text/x-vcard, Size: 152 bytes --]

begin:vcard
fn:Tom Preston-Werner
n:Preston-Werner;Tom
email;internet:tom@mojombo.com
tel;cell:760.672.0832
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git protocol specification
  2008-07-09 18:23 git protocol specification Tom Werner
@ 2008-07-09 18:45 ` Johannes Schindelin
  2008-07-10  1:47   ` Shawn O. Pearce
  2008-07-10  2:32 ` Shawn O. Pearce
  1 sibling, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2008-07-09 18:45 UTC (permalink / raw)
  To: Tom Werner; +Cc: Git Mailing List

Hi,

On Wed, 9 Jul 2008, Tom Werner wrote:

> I'm working on a flexible Erlang replacement for git-daemon and would 
> like to know if there is a specification available for the protocol that 
> git-upload-pack and git-receive-pack use.

How about Documentation/technical/pack-protocol.txt?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git protocol specification
  2008-07-09 18:45 ` Johannes Schindelin
@ 2008-07-10  1:47   ` Shawn O. Pearce
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn O. Pearce @ 2008-07-10  1:47 UTC (permalink / raw)
  To: Tom Werner; +Cc: Johannes Schindelin, Git Mailing List

Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Wed, 9 Jul 2008, Tom Werner wrote:
> 
> > I'm working on a flexible Erlang replacement for git-daemon and would 
> > like to know if there is a specification available for the protocol that 
> > git-upload-pack and git-receive-pack use.
> 
> How about Documentation/technical/pack-protocol.txt?

You may also want to look at jgit's source code.  Its a cleaner
implementation of the protocol in 100% Java.  Not something you
would want to try and call directly from in Erlang, but it may
be easier to follow.

  http://repo.or.cz/w/egit.git/

Look inside of the org.spearce.jgit/src/org/spearce/jgit/transport
package.  In particular the client side of the protocol for git://
is in the TransportGitAnon class as two inner subclasses, one for
fetch ('git-upload-pack') and another for push ('git-receive-pack').

-- 
Shawn.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git protocol specification
  2008-07-09 18:23 git protocol specification Tom Werner
  2008-07-09 18:45 ` Johannes Schindelin
@ 2008-07-10  2:32 ` Shawn O. Pearce
  1 sibling, 0 replies; 4+ messages in thread
From: Shawn O. Pearce @ 2008-07-10  2:32 UTC (permalink / raw)
  To: Tom Werner; +Cc: Git Mailing List

Tom Werner <pubsub@rubyisawesome.com> wrote:
> I'm working on a flexible Erlang replacement for git-daemon and would  
> like to know if there is a specification available for the protocol that  
> git-upload-pack and git-receive-pack use. I've reverse engineered it but  
> have come across some points that seem inconsistent. Before I dig into  
> the C code in earnest I wanted to see if there's anything like spec  
> document for the system. Thanks!

I'm curious, are you planning on implementing git-upload-pack and
git-receive-pack in Erlang as well?  Or are you just doing the
git-daemon frontend and spawn the C git binaries as port processes?

git-receive-pack isn't too much trouble, the protocol on the server
side without the tell-me-more is fairly simple to implement, once
you have something like index-pack or unpack-objects implemented.
But that is somewhat non-trivial to do.

git-upload-pack is much more complex on the server side as you
must actually create the packfile, which means you also need to
compute the set of objects the client is missing, as well as tell
the client when you have enough "have" lines in order to compute
the smallest reasonable pack possible for the data transfer.

I know Erlang is really good at protocol handling and binary
formatting/parsing, but I don't know if you have a good git object
navigation library available to you in Erlang.  Its been years
since I last worked with it, or was involved in its community...  ;-)

-- 
Shawn.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-10  2:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-09 18:23 git protocol specification Tom Werner
2008-07-09 18:45 ` Johannes Schindelin
2008-07-10  1:47   ` Shawn O. Pearce
2008-07-10  2:32 ` Shawn O. Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).