Subject: Re: [PATCH 0/2] gpg-interface: cleanup + convert low hanging fruit to configset API

From: Junio C Hamano <[email-masked]>
Date: Fri, 10 Feb 2023 11:02:06 -0800

Ævar Arnfjörð Bjarmason <[email-masked]> writes:

>> What's your intention of sending these?
>
> For them to be picked up on top of your jc/gpg-lazy-init.
>
>> I think we are already in
>> agreement that the churn may not be worth the risk, so if these are
>> "and here is the churn would look like, not for application", I
>> would understand it and appreciate it.  But did you mean that these
>> patches are for application?  I am not sure...
>
> I understood your "I specifically did not want anybody to start doing
> this line of analysis" in [1] to mean that you didn't want to have the
> sort of change that the last paragraph of 2/2 notes that we're
> deliberately not doing.

I didn't want to see "oh you are calling lazy_init here but you can
delay it even further" kind of comments that is wrong and wastes our
time.  

> I.e. that we'd like to keep the gpg_interface_lazy_init() boilerplate,
> even though we might carefully reason that a specific API entry point
> won't need to initialize the file-scoped config variables right now.

It is the complete opposite of what I meant.

Changing

	git_am_config(...) {
		return git_default_config(...);
	}
	... 
		git_config(git_am_config);

to

	/* no git_am_config() */
	...
		git_config(git_default_config);

is perfectly fine as a clean-up post series.

If we are moving away from git_config() callback style, and move to
git_config_get_*() style, the upthread already said it does not have
a good risk/benefit ratio, but if we were to do so, then we should
not leave some still using the callback style while others using
git_config_get_*(), which will lead to configuration read in a wrong
order and easily breaking precedence rules.

And if we were to move away completely from the callback style, then
I do not see a point to build such a series on top of the lazy init
patch, which is about staying with the callback style.

So, that is exactly why I asked the question after seeing it was
marked to apply on top of the lazy init thing, which did not make
sense to me.