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

2014-06-29 Thread Matthieu Moy
Karsten Blees writes: > Am 28.06.2014 08:01, schrieb Matthieu Moy: >> Karsten Blees 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

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 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 > compl

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

2014-06-27 Thread Matthieu Moy
Karsten Blees 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 this particular value i

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_confi

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

2014-06-27 Thread Matthieu Moy
Karsten Blees writes: > Am 27.06.2014 13:55, schrieb Matthieu Moy: >> Karsten Blees 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 i

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 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 m

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

2014-06-27 Thread Matthieu Moy
Karsten Blees 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 segfault. I disagre

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 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 = cmd

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 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 >> --- >> pager.c | 44 +

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 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 > --- > pager.c | 44 +++- > 1 file

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

2014-06-23 Thread Tanay Abhra
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 --- pager.c | 44 +++- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/pager.c