Re: [PATCH v6 28/32] config: read ref storage config on startup

2016-02-29 Thread David Turner
On Mon, 2016-02-29 at 17:21 -0500, Jeff King wrote: > On Mon, Feb 29, 2016 at 05:10:24PM -0500, Jeff King wrote: > > > > We apparently don't always call check_repo_format before calling > > > git_config_early -- or, more to the point, before doing ref > > > operations. > > > So I think we need

Re: [PATCH v6 28/32] config: read ref storage config on startup

2016-02-29 Thread Jeff King
On Mon, Feb 29, 2016 at 05:10:24PM -0500, Jeff King wrote: > > We apparently don't always call check_repo_format before calling > > git_config_early -- or, more to the point, before doing ref operations. > > So I think we need this in git_config_early. > > That seems horribly broken, though. If

Re: [PATCH v6 28/32] config: read ref storage config on startup

2016-02-29 Thread Jeff King
On Mon, Feb 29, 2016 at 04:57:49PM -0500, David Turner wrote: > > By the way, I notice that the default value for the_refs_backend is > > "_be_files". It might be safer to make this NULL (or some > > _be_null that fills the vtable, but just returns an error for > > each > > call). > > In 'refs:

Re: [PATCH v6 28/32] config: read ref storage config on startup

2016-02-29 Thread Jeff King
On Mon, Feb 29, 2016 at 04:57:42PM -0500, David Turner wrote: > > So I think this setup probably should be in > > check_repository_format_gently(), and should be able to trigger off > > of > > the existing ref_storage_backend string we've already saved (and we > > should bail immediately there if

Re: [PATCH v6 28/32] config: read ref storage config on startup

2016-02-29 Thread David Turner
On Fri, 2016-02-26 at 22:56 -0500, Jeff King wrote: > On Wed, Feb 24, 2016 at 05:59:00PM -0500, David Turner wrote: > > > @@ -1207,6 +1208,29 @@ int git_config_early(config_fn_t fn, void > > *data, const char *repo_config) > > } > > > > if (repo_config && !access_or_die(repo_config,

Re: [PATCH v6 28/32] config: read ref storage config on startup

2016-02-29 Thread David Turner
On Fri, 2016-02-26 at 23:14 -0500, Jeff King wrote: > On Fri, Feb 26, 2016 at 10:56:34PM -0500, Jeff King wrote: > > > My second confusion is why this is happening in git_config_early(). > > That > > function is called during the setup of > > check_repository_format_gently(), > > which is why I

Re: [PATCH v6 28/32] config: read ref storage config on startup

2016-02-26 Thread Jeff King
On Fri, Feb 26, 2016 at 10:56:34PM -0500, Jeff King wrote: > My second confusion is why this is happening in git_config_early(). That > function is called during the setup of check_repository_format_gently(), > which is why I think you wanted to put the code here. But it's _also_ > called as part

Re: [PATCH v6 28/32] config: read ref storage config on startup

2016-02-26 Thread Jeff King
On Wed, Feb 24, 2016 at 05:59:00PM -0500, David Turner wrote: > @@ -1207,6 +1208,29 @@ int git_config_early(config_fn_t fn, void *data, const > char *repo_config) > } > > if (repo_config && !access_or_die(repo_config, R_OK, 0)) { > + char *storage = NULL; > + > +

[PATCH v6 28/32] config: read ref storage config on startup

2016-02-24 Thread David Turner
This sets up the existing backend early, so that other code which reads refs is reading from the right place. Signed-off-by: David Turner --- config.c | 24 1 file changed, 24 insertions(+) diff --git a/config.c b/config.c index