{"thread":{"id":"14376","subject":"git protocol specification","startedAt":"2008-07-09T18:23:45Z","lastAt":"2008-07-10T02:32:55Z","messageCount":4,"participants":["Tom Werner","Johannes Schindelin","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"82740","messageId":"48750231.4020805@rubyisawesome.com","threadId":"14376","inReplyTo":null,"subject":"git protocol specification","fromName":"Tom Werner","fromEmail":"pubsub@rubyisawesome.com","sentAt":"2008-07-09T18:23:45Z","receivedAt":"2008-07-09T18:23:45Z","isPatch":false,"sender":{"key":"pubsub@rubyisawesome.com","avatar":null},"body":"I'm working on a flexible Erlang replacement for git-daemon and would \nlike to know if there is a specification available for the protocol that \ngit-upload-pack and git-receive-pack use. I've reverse engineered it but \nhave come across some points that seem inconsistent. Before I dig into \nthe C code in earnest I wanted to see if there's anything like spec \ndocument for the system. Thanks!\n\n-- \nTom Preston-Werner\ngithub.com/mojombo\n\n\n\nbegin:vcard\nfn:Tom Preston-Werner\nn:Preston-Werner;Tom\nemail;internet:tom@mojombo.com\ntel;cell:760.672.0832\nx-mozilla-html:FALSE\nversion:2.1\nend:vcard\n\n"},{"id":"82744","messageId":"alpine.DEB.1.00.0807092044120.4010@eeepc-johanness","threadId":"14376","inReplyTo":"48750231.4020805@rubyisawesome.com","subject":"Re: git protocol specification","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-09T18:45:04Z","receivedAt":"2008-07-09T18:45:04Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 9 Jul 2008, Tom Werner wrote:\n\n> I'm working on a flexible Erlang replacement for git-daemon and would \n> like to know if there is a specification available for the protocol that \n> git-upload-pack and git-receive-pack use.\n\nHow about Documentation/technical/pack-protocol.txt?\n\nCiao,\nDscho\n"},{"id":"82767","messageId":"20080710014750.GA7714@spearce.org","threadId":"14376","inReplyTo":"alpine.DEB.1.00.0807092044120.4010@eeepc-johanness","subject":"Re: git protocol specification","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-10T01:47:50Z","receivedAt":"2008-07-10T01:47:50Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> On Wed, 9 Jul 2008, Tom Werner wrote:\n> \n> > I'm working on a flexible Erlang replacement for git-daemon and would \n> > like to know if there is a specification available for the protocol that \n> > git-upload-pack and git-receive-pack use.\n> \n> How about Documentation/technical/pack-protocol.txt?\n\nYou may also want to look at jgit's source code.  Its a cleaner\nimplementation of the protocol in 100% Java.  Not something you\nwould want to try and call directly from in Erlang, but it may\nbe easier to follow.\n\n  http://repo.or.cz/w/egit.git/\n\nLook inside of the org.spearce.jgit/src/org/spearce/jgit/transport\npackage.  In particular the client side of the protocol for git://\nis in the TransportGitAnon class as two inner subclasses, one for\nfetch ('git-upload-pack') and another for push ('git-receive-pack').\n\n-- \nShawn.\n"},{"id":"82770","messageId":"20080710023255.GA8061@spearce.org","threadId":"14376","inReplyTo":"48750231.4020805@rubyisawesome.com","subject":"Re: git protocol specification","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-10T02:32:55Z","receivedAt":"2008-07-10T02:32:55Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Tom Werner <pubsub@rubyisawesome.com> wrote:\n> I'm working on a flexible Erlang replacement for git-daemon and would  \n> like to know if there is a specification available for the protocol that  \n> git-upload-pack and git-receive-pack use. I've reverse engineered it but  \n> have come across some points that seem inconsistent. Before I dig into  \n> the C code in earnest I wanted to see if there's anything like spec  \n> document for the system. Thanks!\n\nI'm curious, are you planning on implementing git-upload-pack and\ngit-receive-pack in Erlang as well?  Or are you just doing the\ngit-daemon frontend and spawn the C git binaries as port processes?\n\ngit-receive-pack isn't too much trouble, the protocol on the server\nside without the tell-me-more is fairly simple to implement, once\nyou have something like index-pack or unpack-objects implemented.\nBut that is somewhat non-trivial to do.\n\ngit-upload-pack is much more complex on the server side as you\nmust actually create the packfile, which means you also need to\ncompute the set of objects the client is missing, as well as tell\nthe client when you have enough \"have\" lines in order to compute\nthe smallest reasonable pack possible for the data transfer.\n\nI know Erlang is really good at protocol handling and binary\nformatting/parsing, but I don't know if you have a good git object\nnavigation library available to you in Erlang.  Its been years\nsince I last worked with it, or was involved in its community...  ;-)\n\n-- \nShawn.\n"}]}