Re: [PATCH 0/6] [RFC] config.c: use struct for config reading state
- From
Glen Choo <chooglen@google.com>
- Date
- Mar 7, 2023, 22:53 UTC
- Message-ID
- <kl6lcz5ki36g.fsf@chooglen-macbookpro.roam.corp.google.com>
- In-Reply-To
- <xmqqbkl4xsj2.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 19 quoted lines
> If you include "populate from system-wide, per-user, and repository > specific configuration files" as part of the API being libified, > your configsets cannot avoid being tied to a repository. But I do > not think the reader needs to be in the repository. > > [...] > > Isn't the use of the reader object purely transitory while you > populate the keys and values in a configset from a single file? At > the layer to read and populate a configset from a single "source" > file, you still do not need repository. > > [...] > Only when you say "I have a 'repo' instance and I want to read the > config variables from appropriate places", you call such a "read and > populate configset from a single source" helper three or four times > to populate repo->config. Once a configset is populated, it or its > contents do not depend on the reader instance to function, so I do > not see how it benefits to have the reader in the repository object.
Yes, exactly. Having a config_set on the repository makes sense, but I don't see a good reason to have the reader on the repository.
If Ævar sends his series soon, it would be fruitful to see how that series interacts with this one :)