From: Derrick Stolee <derrickstolee@github.com>
To: Taylor Blau <me@ttaylorr.com>, git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Emily Shaffer" <emilyshaffer@google.com>
Subject: Re: [PATCH v3 2/2] config: let feature.experimental imply gc.cruftPacks=true
Date: Mon, 31 Oct 2022 06:46:30 -0400 [thread overview]
Message-ID: <fe5658f8-ac50-b328-f286-ef0971455046@github.com> (raw)
In-Reply-To: <13a25a425bc0901ee38760095eb1bcf314c00da2.1666819953.git.me@ttaylorr.com>
On 10/26/22 5:32 PM, Taylor Blau wrote:
> From: Emily Shaffer <emilyshaffer@google.com>
>
> We are interested in exploring whether gc.cruftPacks=true should become
> the default value.
>
> To determine whether it is safe to do so, let's encourage more users to
> try it out.
>
> Users who have set feature.experimental=true have already volunteered to
> try new and possibly-breaking config changes, so let's try this new
> default with that set of users.
>
> Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
> Signed-off-by: Taylor Blau <me@ttaylorr.com>
> ---
> Documentation/config/feature.txt | 3 ++
> builtin/gc.c | 7 +++--
> repo-settings.c | 1 +
> repository.h | 1 +
> t/t6500-gc.sh | 53 ++++++++++++++++++++++++++++++++
> 5 files changed, 63 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/config/feature.txt b/Documentation/config/feature.txt
> index cdecd04e5b..95975e5091 100644
> --- a/Documentation/config/feat
> + prepare_repo_settings(the_repository);
> + if (cruft_packs < 0)
> + cruft_packs = the_repository->settings.gc_cruft_packs;
> +
Here, we are checking if cruft_packs hasn't been set by the
command-line arguments _or_ the gc.cruftPacks config option
(as checked in gc_config()). However, we now have another
parameter saying "enable it by the experimental flag".
You are applying things in the correct order here, but I
wanted to point out...
> @@ -43,6 +43,7 @@ void prepare_repo_settings(struct repository *r)
> /* Defaults modified by feature.* */
> if (experimental) {
> r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
> + r->settings.gc_cruft_packs = 1;
> }
> if (manyfiles) {
> r->settings.index_version = 4;
That later in prepare_repo_settings(), we check the exact
config values so that the repo_settings reflects the full
implications from config:
/* Commit graph config or default, does not cascade (simple) */
repo_cfg_bool(r, "core.commitgraph", &r->settings.core_commit_graph, 1);
repo_cfg_int(r, "commitgraph.generationversion", &r->settings.commit_graph_generation_version, 2);
repo_cfg_bool(r, "commitgraph.readchangedpaths", &r->settings.commit_graph_read_changed_paths, 1);
repo_cfg_bool(r, "gc.writecommitgraph", &r->settings.gc_write_commit_graph, 1);
repo_cfg_bool(r, "fetch.writecommitgraph", &r->settings.fetch_write_commit_graph, 0);
/* Boolean config or default, does not cascade (simple) */
repo_cfg_bool(r, "pack.usesparse", &r->settings.pack_use_sparse, 1);
repo_cfg_bool(r, "core.multipackindex", &r->settings.core_multi_pack_index, 1);
repo_cfg_bool(r, "index.sparse", &r->settings.sparse_index, 0);
This allows us to use the_repository->settings.* members
as placeholders for the full implications from config.
So this implementation has some slight differences from
other repo_settings implementations. It's correct, and the
use of gc.cruftPacks is pretty isolated, but I wonder if
we should be sticklers about this pattern in repo_settings.
Thanks,
-Stolee
P.S. I found this draft open on my laptop when I opened it
this morning. Hopefully it's not too late.
prev parent reply other threads:[~2022-10-31 10:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 20:13 [PATCH v2 0/2] gc: let feature.experimental imply gc.cruftPacks Taylor Blau
2022-10-26 20:13 ` [PATCH v2 1/2] gc: add tests for --cruft and friends Taylor Blau
2022-10-26 21:03 ` Junio C Hamano
2022-10-26 20:13 ` [PATCH v2 2/2] config: let feature.experimental imply gc.cruftPacks=true Taylor Blau
2022-10-26 21:15 ` Junio C Hamano
2022-10-26 21:32 ` Taylor Blau
2022-10-26 20:53 ` [PATCH v2 0/2] gc: let feature.experimental imply gc.cruftPacks Junio C Hamano
2022-10-26 21:32 ` [PATCH v3 " Taylor Blau
2022-10-26 21:32 ` [PATCH v3 1/2] gc: add tests for --cruft and friends Taylor Blau
2022-10-26 21:32 ` [PATCH v3 2/2] config: let feature.experimental imply gc.cruftPacks=true Taylor Blau
2022-10-31 10:46 ` Derrick Stolee [this message]
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=fe5658f8-ac50-b328-f286-ef0971455046@github.com \
--to=derrickstolee@github.com \
--cc=avarab@gmail.com \
--cc=emilyshaffer@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.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.
Code repositories for project(s) associated with this public 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).