Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 27, 2015, 17:30 UTC
- Message-ID
- <CAPig+cSFEN+V0668FPDM1jY2KdW_nVaEn7+AOWJj_KwUU_UVPw@mail.gmail.com>
- In-Reply-To
- <20150527063558.GB885@peff.net>
On Wed, May 27, 2015 at 2:35 AM, Jeff King <peff@peff.net> wrote:
Show 19 quoted lines
> 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, 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 *capabilities[] = {
> "multi_ack",
> "thin-pack",
> ... etc ...
> };
>
> and then loop over the array?Yes, that would be much nicer. I also had this in mind but didn't know if there was a strong reason for the capabilities to be shoehorned into a single string as they are currently.