Subject: Re: More on git over HTTP POST

From: "Shawn O. Pearce" <[email-masked]>
Date: Sat, 2 Aug 2008 20:31:55 -0700

Junio C Hamano <[email-masked]> wrote:
> "Shawn O. Pearce" <[email-masked]> writes:
> 
> > Show Refs
> > ---------
> >
> > Obtains the available refs from the remote repository.  The response
> > is a sequence of git "packet lines", one per ref, and a final flush
> > packet line to indicate the end of stream.
> 
> As the initial protocol exchange request, I suspect that you would regret
> if you do not leave room for some "capability advertisement" in this
> exchange.
> 
> With the git native protocol, we luckily found space to do so after the
> ref payload (because pkt-line is "length + payload" format but the code
> that reads payload happened to ignore anything after NUL).  You would want
> to define how these are given by the server to the client over HTTP
> channel.  For example, putting them on extra HTTP headers is probably Ok.

Yea, I thought that the HTTP headers would be more than enough
space to add capability advertisements.  Most client libraries
will happily parse and store these for the application, and won't
make a fuss if the application doesn't read them.

Hence there's more than enough room in the protocol to extend it
in the future with additional capabilities.

We do have to be careful though.  Any cachable resource must only
rely upon the URI and the standard headers which compute into the
cache key for a request.  There aren't many, though I think the
Content-Type header may be among them.

-- 
Shawn.