From: Eric Sunshine Date: Wed, 27 May 2015 17:30:28 GMT Subject: Re: [RFC/WIP PATCH 04/11] upload-pack-2: Implement the version 2 of upload-pack Message-ID: In-Reply-To: <20150527063558.GB885@peff.net> On Wed, May 27, 2015 at 2:35 AM, Jeff King 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, 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.