Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-29 Thread Matthieu Moy
Karsten Blees karsten.bl...@gmail.com writes: Am 28.06.2014 08:01, schrieb Matthieu Moy: Karsten Blees karsten.bl...@gmail.com writes: I still don't like that the invalidation is done in git_config_set, though, as this is also used to write completely unrelated files. I don't get it.

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-28 Thread Matthieu Moy
Karsten Blees karsten.bl...@gmail.com writes: I still don't like that the invalidation is done in git_config_set, though, as this is also used to write completely unrelated files. I don't get it. It is used to write the config files. Yes, we trigger a complete reload instead of just changing

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-28 Thread Karsten Blees
Am 28.06.2014 08:01, schrieb Matthieu Moy: Karsten Blees karsten.bl...@gmail.com writes: I still don't like that the invalidation is done in git_config_set, though, as this is also used to write completely unrelated files. I don't get it. It is used to write the config files. Yes, we

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-27 Thread Matthieu Moy
Karsten Blees karsten.bl...@gmail.com writes: If for some reason a config string is accessed after config_cache_free() (which would be a bug), you won't notice if strings are xstrdup()ed (i.e. git will continue to run with some invalid configuration). This is IMO much worse than failing with

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-27 Thread Karsten Blees
Am 27.06.2014 13:55, schrieb Matthieu Moy: Karsten Blees karsten.bl...@gmail.com writes: If for some reason a config string is accessed after config_cache_free() (which would be a bug), you won't notice if strings are xstrdup()ed (i.e. git will continue to run with some invalid

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-27 Thread Matthieu Moy
Karsten Blees karsten.bl...@gmail.com writes: Am 27.06.2014 13:55, schrieb Matthieu Moy: Karsten Blees karsten.bl...@gmail.com writes: If for some reason a config string is accessed after config_cache_free() (which would be a bug), you won't notice if strings are xstrdup()ed (i.e. git

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-27 Thread Karsten Blees
Am 27.06.2014 21:19, schrieb Matthieu Moy: The reason for which setting any config value invalidates the cache is that it is _much_ simpler to implement. Less complexity, less corner-cases, less bugs. I think I see what you mean. E.g. in cmd_clone we have: write_config(option_config);

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-26 Thread Tanay Abhra
On 6/25/2014 9:29 AM, Eric Sunshine wrote: On Mon, Jun 23, 2014 at 6:41 AM, Tanay Abhra tanay...@gmail.com wrote: Use git_config_get_string instead of git_config to take advantage of the config hash-table api which provides a cleaner control flow. Signed-off-by: Tanay Abhra

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-26 Thread Karsten Blees
Am 25.06.2014 05:59, schrieb Eric Sunshine: On Mon, Jun 23, 2014 at 6:41 AM, Tanay Abhra tanay...@gmail.com wrote: [...] /* returns 0 for no pager, 1 for use pager, and -1 for not specified */ int check_pager_config(const char *cmd) { - struct pager_config c; - c.cmd =

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-24 Thread Eric Sunshine
On Mon, Jun 23, 2014 at 6:41 AM, Tanay Abhra tanay...@gmail.com wrote: Use git_config_get_string instead of git_config to take advantage of the config hash-table api which provides a cleaner control flow. Signed-off-by: Tanay Abhra tanay...@gmail.com --- pager.c | 44