Re: [PATCH v6 28/32] config: read ref storage config on startup
- From
David Turner <dturner@twopensource.com>
- Date
- Feb 29, 2016, 21:57 UTC
- Message-ID
- <1456783069.18017.66.camel@twopensource.com>
- In-Reply-To
- <20160227041416.GA11604@sigill.intra.peff.net>
On Fri, 2016-02-26 at 23:14 -0500, Jeff King wrote:
Show 27 quoted lines
> 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 of a regular git_config(). Which means we're parsing > > the > > repo config and setting the ref backend all over again, every time > > we > > look at config for other reasons. > > > > 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 we don't know about the backend, > > as it > > means we _don't_ match the repo's extensions and cannot proceed). > > By the way, I notice that the default value for the_refs_backend is > "&refs_be_files". It might be safer to make this NULL (or some > &refs_be_null that fills the vtable, but just returns an error for > each > call).
In 'refs: register ref storage backends', I do make this change. I don't do it earlier because we don't have this config stuff in place yet.