Subject: Re: [PATCH v2 02/12] builtin/verify-tag: stop using `the_repository`

From: Junio C Hamano <[email-masked]>
Date: Thu, 27 Feb 2025 14:39:09 -0800

Usman Akinyemi <[email-masked]> writes:

> While going through the config.c I saw the
> read_very_early_config() which read the config from the system and
> global settings and does not require any repo variable. I think,
> to teach the repo_config() to allow NULL value, we could call the
> read_very_early_config() whenever the repo is NULL as we know,
> this happens outside the repository.

Yeah, when I wrote the message you were responding to, I noticed
that do_git_config_sequence() is prepared to take NULL as repo (even
though it is a bit clunky interface; you need to futz with members
of the opts structure like opts->ignore_repo to have the code ignore
repo that is NULL).  So a caller that calls config_with_options() with
no config_source and no repo should be a good candidate to reuse.

As we positively know that we are not in a repository in our case,
using read_very_early_config() when repo is NULL sounds like a
sensible thing to do, I would think.

Thanks.