git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/9] config: teach repo_config to allow `repo` to be NULL

From
Usman Akinyemi <usmanakinyemi202@gmail.com>
Date
Mar 21, 2025, 06:56 UTC
Message-ID
<CAPSxiM9RDiBqqGsQmAFD5RvCh6ABXegUvpyzOC81Te3-NKX7Yg@mail.gmail.com>
In-Reply-To
<Z9vB-Mm9YpIcv6UK@pks.im>
On Thu, Mar 20, 2025 at 12:51 PM Patrick Steinhardt <ps@pks.im> wrote:
Show 20 quoted lines
>
> On Tue, Mar 18, 2025 at 05:28:53PM +0530, Usman Akinyemi wrote:
> > diff --git a/config.c b/config.c
> > index 658569af08..e127afaa8f 100644
> > --- a/config.c
> > +++ b/config.c
> > @@ -2521,6 +2521,10 @@ void repo_config_clear(struct repository *repo)
> >
> >  void repo_config(struct repository *repo, config_fn_t fn, void *data)
> >  {
> > +     if (!repo) {
> > +             read_very_early_config(fn, data);
> > +             return;
> > +     }
>
> I remember discussion that `read_very_early_config()` may not be a good
> fit here. Most importantly, it ignores any configuration passed on the
> command line, which I would think is very surprising behaviour. So
> should we adapt this to instead manually call `config_with_options()`
> with the expected bits set?
Hi Patrick,
Sorry for the confusion.

There was a discussion about this here. https://public-inbox.org/git/xmqqbjum2ayc.fsf@gitster.g/ https://public-inbox.org/git/xmqqcyeuhwqb.fsf@gitster.g/

Mainliy ignoring the configuration passed from cmdline for this purpose.
I was sending this patch again mainly for the 9/9 patch.
Thanks.
>
> Patrick
Previous: Patrick SteinhardtNext: Usman Akinyemi
Message 4 of 17 in “remove unnecessary if statement”
  1. 0/9 remove unnecessary if statementUsman Akinyemi, Mar 18, 2025
  2. 1/9 config: teach repo_config to allow `repo` to be NULLUsman Akinyemi, Mar 18, 2025
  3. Patrick SteinhardtMar 20, 2025
  4. Usman AkinyemiMar 21, 2025
  5. 2/9 builtin/verify-tag: stop using `the_repository`Usman Akinyemi, Mar 18, 2025
  6. Patrick SteinhardtMar 20, 2025
  7. 3/9 builtin/verify-commit: stop using `the_repository`Usman Akinyemi, Mar 18, 2025
  8. 4/9 builtin/send-pack: stop using `the_repository`Usman Akinyemi, Mar 18, 2025
  9. 5/9 builtin/pack-refs: stop using `the_repository`Usman Akinyemi, Mar 18, 2025
  10. 6/9 builtin/ls-files: stop using `the_repository`Usman Akinyemi, Mar 18, 2025
  11. 7/9 builtin/for-each-ref: stop using `the_repository`Usman Akinyemi, Mar 18, 2025
  12. 8/9 builtin/checkout-index: stop using `the_repository`Usman Akinyemi, Mar 18, 2025
  13. 9/9 builtin/update-server-info: remove unnecessary if statementUsman Akinyemi, Mar 18, 2025
  14. Patrick SteinhardtMar 20, 2025
  15. Usman AkinyemiMar 21, 2025
  16. Junio C HamanoMar 18, 2025
  17. Usman AkinyemiMar 19, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.