dulwich-users team mailing list archive
-
dulwich-users team
-
Mailing list archive
-
Message #00505
Re: Push example and client http support
On Fri, Apr 22, 2011 at 13:11, Julien Danjou <julien@xxxxxxxxxxx> wrote:
> On Fri, Apr 22 2011, Dave Borowitz wrote:
>
> > hg-git has examples of actually using the client module, and perhaps
> Augie
> > can chime in with some of his experience.
>
> Yeah, that does help, thanks a lot.
> It seems that object_store.generate_pack_contents can be used to
> generate packs. Maybe that could be set a a default in send/push method.
>
> I'll deep further and see how I can write a determine_wants function.
>
> > It is the hardest to support :)
>
> I should have guessed it.
>
> > The stateless HTTP protocol is different from but related to the stateful
> > TCP wire protocol, so it's not just a matter of making an HTTP connection
> > instead of TCP/SSH.
>
> Yeah, I though it was that way. I at least hope supporting the smart
> version of the HTTP protocol is not *that* hard. :-|
In a nutshell: there is a back-and-forth of HTTP requests/responses until
the client sends "done". In the n+1th request, the client begins by sending
one "have" line for each "ACK <sha> common" received in the nth request.
This allows the server to essentially recreate the state it would have had
by this point in the corresponding stateful negotiation. (Take a moment and
convince yourself that this is the case.)
> > I would poke around in the Documentation/technical directory of git.git
> > until you understand the wire protocol; that's basically what I did to
> > implement HTTP server support. If you have questions, I can help clarify,
> or
> > you can ask the git mailing list about things where the documentation is
> > unclear.
>
> I already read and understood most of the protocol, but did not spend
> time imagining how I would implement the HTTP client, since I though
> until 1 hour ago that Dulwich supported it.
> But I'll dig further as soon as I've some time to spend on it and will
> come back to bother you if I need.
>
> Thanks for the hints Dave. :)
>
> --
> Julien Danjou
> ❱ http://julien.danjou.info
>
References