git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Usman Akinyemi <usmanakinyemi202@gmail.com>
Cc: git@vger.kernel.org, christian.couder@gmail.com,
	gitster@pobox.com, johncai86@gmail.com, me@ttaylorr.com,
	phillip.wood123@gmail.com, shejialuo@gmail.com,
	Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH 1/9] config: teach repo_config to allow `repo` to be NULL
Date: Thu, 20 Mar 2025 08:21:28 +0100	[thread overview]
Message-ID: <Z9vB-Mm9YpIcv6UK@pks.im> (raw)
In-Reply-To: <20250318115912.2978992-2-usmanakinyemi202@gmail.com>

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?

Patrick

  reply	other threads:[~2025-03-20  7:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18 11:58 [PATCH 0/9] remove unnecessary if statement Usman Akinyemi
2025-03-18 11:58 ` [PATCH 1/9] config: teach repo_config to allow `repo` to be NULL Usman Akinyemi
2025-03-20  7:21   ` Patrick Steinhardt [this message]
2025-03-21  6:56     ` Usman Akinyemi
2025-03-18 11:58 ` [PATCH 2/9] builtin/verify-tag: stop using `the_repository` Usman Akinyemi
2025-03-20  7:21   ` Patrick Steinhardt
2025-03-18 11:58 ` [PATCH 3/9] builtin/verify-commit: " Usman Akinyemi
2025-03-18 11:58 ` [PATCH 4/9] builtin/send-pack: " Usman Akinyemi
2025-03-18 11:58 ` [PATCH 5/9] builtin/pack-refs: " Usman Akinyemi
2025-03-18 11:58 ` [PATCH 6/9] builtin/ls-files: " Usman Akinyemi
2025-03-18 11:58 ` [PATCH 7/9] builtin/for-each-ref: " Usman Akinyemi
2025-03-18 11:59 ` [PATCH 8/9] builtin/checkout-index: " Usman Akinyemi
2025-03-18 11:59 ` [PATCH 9/9] builtin/update-server-info: remove unnecessary if statement Usman Akinyemi
2025-03-20  7:21   ` Patrick Steinhardt
2025-03-21  7:00     ` Usman Akinyemi
2025-03-18 20:21 ` [PATCH 0/9] " Junio C Hamano
2025-03-19  3:53   ` Usman Akinyemi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z9vB-Mm9YpIcv6UK@pks.im \
    --to=ps@pks.im \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johncai86@gmail.com \
    --cc=me@ttaylorr.com \
    --cc=phillip.wood123@gmail.com \
    --cc=shejialuo@gmail.com \
    --cc=usmanakinyemi202@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).