Re: [RFC/PATCH v2 1/2] config: Add hashtable for config parsing & retrieval

2014-06-09 Thread Eric Sunshine
In addition to the valuable review comments by Torsten and Peff, find more below... On Mon, Jun 2, 2014 at 10:47 AM, Tanay Abhra wrote: > Add a hash table to cache all key-value pairs read from config files > (repo specific .git/config, user wide ~/.gitconfig and the global > /etc/gitconfig). Add

Re: [RFC/PATCH v2 1/2] config: Add hashtable for config parsing & retrieval

2014-06-03 Thread Jeff King
On Mon, Jun 02, 2014 at 07:47:39AM -0700, Tanay Abhra wrote: > +static int config_cache_entry_cmp_icase(const struct config_cache_entry *e1, > + const struct config_cache_entry *e2, const > char* key) > +{ > + return strcasecmp(e1->key, key ? key : e2->key); > +}

Re: [RFC/PATCH v2 1/2] config: Add hashtable for config parsing & retrieval

2014-06-02 Thread Torsten Bögershausen
On 2014-06-02 16.47, Tanay Abhra wrote: [] Please see 3 minor remarks inline. > --- a/config.c > +++ b/config.c > @@ -9,6 +9,8 @@ > #include "exec_cmd.h" > #include "strbuf.h" > #include "quote.h" > +#include "hashmap.h" > +#include "string-list.h" > > struct config_source { > struct c

[RFC/PATCH v2 1/2] config: Add hashtable for config parsing & retrieval

2014-06-02 Thread Tanay Abhra
Add a hash table to cache all key-value pairs read from config files (repo specific .git/config, user wide ~/.gitconfig and the global /etc/gitconfig). Add two external functions `git_config_get_string` and `git_config_get_string_multi` for querying in a non-callback manner from the hash table. Si