Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Eric Sunshine
On Wed, May 27, 2015 at 2:35 AM, Jeff King p...@peff.net wrote: On Tue, May 26, 2015 at 03:01:08PM -0700, Stefan Beller wrote: +static void send_capabilities(void) +{ + char buf[100]; + + while (next_capability(buf)) + packet_write(1, capability:%s\n, buf); Like Eric,

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Stefan Beller
On Tue, May 26, 2015 at 11:35 PM, Jeff King p...@peff.net wrote: On Tue, May 26, 2015 at 03:01:08PM -0700, Stefan Beller wrote: --- a/upload-pack.c +++ b/upload-pack.c @@ -716,10 +716,47 @@ static void format_symref_info(struct strbuf *buf, struct string_list *symref)

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 01:30:28PM -0400, Eric Sunshine wrote: Like Eric, I find the whole next_capability thing a little ugly. His suggestion to pass in the parsing state is an improvement, but I wonder why we need to parse at all. Can we keep the capabilities as: const char

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 01:45:55PM -0700, Stefan Beller wrote: Right, but I think (and please correct me if there's a case I'm missing) that the behavior is the same whether it is spelled ping-pong or capability:ping-pong. That is, the rule for capability: is if you do not understand it,

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Stefan Beller
On Wed, May 27, 2015 at 1:34 PM, Jeff King p...@peff.net wrote: On Wed, May 27, 2015 at 10:40:37AM -0700, Stefan Beller wrote: If we are upload-pack-2, should we advertise that in the capabilities? I think it may make things easier later if we try to provide some opportunistic out-of-band

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 10:40:37AM -0700, Stefan Beller wrote: If we are upload-pack-2, should we advertise that in the capabilities? I think it may make things easier later if we try to provide some opportunistic out-of-band data. E.g., if see tell git-daemon: git-upload-pack

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-27 Thread Jeff King
On Tue, May 26, 2015 at 03:01:08PM -0700, Stefan Beller wrote: --- a/upload-pack.c +++ b/upload-pack.c @@ -716,10 +716,47 @@ static void format_symref_info(struct strbuf *buf, struct string_list *symref) strbuf_addf(buf, symref=%s:%s, item-string, (char *)item-util); }

Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-26 Thread Eric Sunshine
On Tue, May 26, 2015 at 6:01 PM, Stefan Beller sbel...@google.com wrote: In upload-pack-2 we send each capability in its own packet. By reusing the advertise_capabilities and eventually setting it to NULL we will be able to reuse the methods for refs advertisement. Signed-off-by: Stefan

[RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack

2015-05-26 Thread Stefan Beller
In upload-pack-2 we send each capability in its own packet. By reusing the advertise_capabilities and eventually setting it to NULL we will be able to reuse the methods for refs advertisement. Signed-off-by: Stefan Beller sbel...@google.com --- .gitignore | 1 + Makefile| 2 ++