[PATCH v2 2/2] make config --add behave correctly for empty and NULL values

2014-09-12 Thread Tanay Abhra
The problem lies with the regexp used for simulating --add in `git_config_set_multivar_in_file()`, ^$, which in ideal case should not match with any string but is true for empty strings. Instead use a sentinel value CONFIG_REGEX_NONE to say we do not want to replace any existing entry and use it

Re: [PATCH v2 2/2] make config --add behave correctly for empty and NULL values

2014-09-12 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: +const char CONFIG_REGEX_NONE[] = a^; I have a slight preference for this version (no magic (void *)1 value, and belts-and-suspenders solution since someone actually using the regex should still get a correct behavior. But I'm fine with both Junio/Peff's

Re: [PATCH v2 2/2] make config --add behave correctly for empty and NULL values

2014-09-12 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: Tanay Abhra tanay...@gmail.com writes: +const char CONFIG_REGEX_NONE[] = a^; I have a slight preference for this version (no magic (void *)1 value, and belts-and-suspenders solution since someone actually using the regex should still get a