git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Derrick Stolee <stolee@gmail.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] sparse-index.c: don't call prepare_repo_settings() twice in a row
Date: Thu, 06 May 2021 12:55:24 +0900	[thread overview]
Message-ID: <xmqqwnsczfbn.fsf@gitster.g> (raw)
In-Reply-To: <7954338a-bb44-1345-61b6-787782063c3c@gmail.com> (Derrick Stolee's message of "Wed, 5 May 2021 10:00:55 -0400")

Derrick Stolee <stolee@gmail.com> writes:

> On 5/5/2021 8:11 AM, Ævar Arnfjörð Bjarmason wrote:
>> Change code added in 58300f47432 (sparse-index: add index.sparse
>> config option, 2021-03-30) to only call prepare_repo_settings()
>> once. We know that our own set_sparse_index_config() has just finished
>> calling it, so we don't need to call it if we're acting on "test_env".
>
> I'm not sure about the value here. prepare_repo_settings() returns
> quickly if the settings have already been prepared, so a second call
> is negligible in cost.
>
>> @@ -133,11 +133,12 @@ int convert_to_sparse(struct index_state *istate)
>>  	test_env = git_env_bool("GIT_TEST_SPARSE_INDEX", -1);
>>  	if (test_env >= 0)
>>  		set_sparse_index_config(istate->repo, test_env);
>> +	else
>> +		prepare_repo_settings(istate->repo);
>
> The change presented here to either call set_sparse_index_config()
> _or_ prepare_repo_settings() seems like it knows too much about
> how set_sparse_index_config() works.

I tend to agree on both counts.

Thanks.

  reply	other threads:[~2021-05-06  3:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 12:11 [PATCH 0/2] sparse-index.c: minor prepare_repo_settings() fixes Ævar Arnfjörð Bjarmason
2021-05-05 12:11 ` [PATCH 1/2] sparse-index.c: remove set_index_sparse_config() Ævar Arnfjörð Bjarmason
2021-05-05 14:01   ` Derrick Stolee
2021-05-05 12:11 ` [PATCH 2/2] sparse-index.c: don't call prepare_repo_settings() twice in a row Ævar Arnfjörð Bjarmason
2021-05-05 14:00   ` Derrick Stolee
2021-05-06  3:55     ` Junio C Hamano [this message]
2021-05-06  8:49     ` Ævar Arnfjörð Bjarmason
2021-05-17 17:31       ` Derrick Stolee

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqwnsczfbn.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=stolee@gmail.com \
    --subject='Re: [PATCH 2/2] sparse-index.c: don'\''t call prepare_repo_settings() twice in a row' \
    /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

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).