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 *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. I don't think there is a good reason, beyond it being the simplest thing for the current code to work. But as you can see from the existing packet_write() in upload-pack, it's already going through some contortions to handle optional capabilities (i.e., "capabilities" is by no means the full list anymore). Doing it item by item will mean we can't use a single packet_write() in the v1 code, but it's OK to format into a buffer here (we already need such a buffer for format_symref_info anyway). -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html