Re: [PATCH 1/6] config: add helper function for parsing key names

2013-01-18 Thread Junio C Hamano
Junio C Hamano writes: > Jeff King writes: > >> ... did you have any comment on >> the "struct config_key" alternative I sent as a follow-up? > > I did read it but I cannot say I did so very carefully. My gut > reaction was that the "take the variable name and section name, > return the subsect

Re: [PATCH 1/6] config: add helper function for parsing key names

2013-01-15 Thread Junio C Hamano
Jeff King writes: > ... did you have any comment on > the "struct config_key" alternative I sent as a follow-up? I did read it but I cannot say I did so very carefully. My gut reaction was that the "take the variable name and section name, return the subsection name pointer and length, if there

Re: [PATCH 1/6] config: add helper function for parsing key names

2013-01-15 Thread Jeff King
On Mon, Jan 14, 2013 at 10:08:47AM -0800, Junio C Hamano wrote: > > +extern int match_config_key(const char *var, > > +const char *section, > > +const char **subsection, int *subsection_len, > > +const char **key); > > + > > I agree with Jonathan ab

Re: [PATCH 1/6] config: add helper function for parsing key names

2013-01-14 Thread Junio C Hamano
Jeff King writes: > The config callback functions get keys of the general form: > > section.subsection.key > > (where the subsection may be contain arbitrary data, or may > be missing). For matching keys without subsections, it is > simple enough to call "strcmp". Matching keys with > subsectio