From: Derrick Stolee <stolee@gmail.com>
To: Shubham Kanodia via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Cc: "Patrick Steinhardt [ ]" <ps@pks.im>,
"Junio C Hamano [ ]" <gitster@pobox.com>,
Shubham Kanodia <shubham.kanodia10@gmail.com>
Subject: Re: [PATCH] remote: prefetch config
Date: Wed, 4 Sep 2024 16:03:34 -0400 [thread overview]
Message-ID: <e8232cdc-7a5d-485e-84f7-2c05e17f9907@gmail.com> (raw)
In-Reply-To: <pull.1779.git.1725472799637.gitgitgadget@gmail.com>
On 9/4/24 1:59 PM, Shubham Kanodia via GitGitGadget wrote:
> From: Shubham Kanodia <shubham.kanodia10@gmail.com>
>
> Large repositories often contain numerous branches and refs, many of
> which individual users may not need. This commit introduces a new
> configuration option (`remote.<remote>.prefetch`) to allow
> users to specify which remotes to prefetch during
> the maintenance task.
>
> Key behaviors:
> 1. If `remote.<remote>.prefetch` is unset or true, running
> `git-maintenance` will prefetch all refs for the remote.
> 2. If `remote.<remote>.prefetch` is set to false, the remote
> will be ignored for prefetching.
Thanks for this contribution. I think this is a good idea for extra
flexibility of the prefetch task.
> In a future change, we could also allow restricting the refs that are
> prefetched per remote using the `prefetchref` config option per remote.
I agree that this would also be of interest, but more complicated. Thanks
for starting with this simpler modification.
> + if (remote->prefetch == 0)
> + return 0;
In the Git codebase, this would normally be written as
if (!remote->prefetch)
return 0;
> + # Run maintenance prefetch task
> + GIT_TRACE2_EVENT="$(pwd)/prefetch.txt" git maintenance run --task=prefetch 2>/dev/null &&
> +
> + # Check that remote1 was not fetched (prefetch=false)
> + test_subcommand ! git fetch remote1 --prefetch --prune --no-tags \
> + --no-write-fetch-head --recurse-submodules=no --quiet \
> + <prefetch.txt &&
I'm happy to see this use of test_subcommand to validate the behavior
of this patch!
This is a very good patch and I only have the one style nit.
Thanks,
-Stolee
next prev parent reply other threads:[~2024-09-04 20:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 17:59 [PATCH] remote: prefetch config Shubham Kanodia via GitGitGadget
2024-09-04 20:03 ` Derrick Stolee [this message]
2024-09-04 20:55 ` Junio C Hamano
2024-09-05 2:08 ` Derrick Stolee
2024-09-05 2:51 ` Shubham Kanodia
2024-09-05 15:00 ` Junio C Hamano
2024-09-05 2:52 ` [PATCH v2] " Shubham Kanodia via GitGitGadget
2024-09-05 16:06 ` Junio C Hamano
2024-09-05 16:43 ` Shubham Kanodia
2024-09-05 16:52 ` Junio C Hamano
2024-09-05 17:19 ` Shubham Kanodia
2024-09-05 17:54 ` Junio C Hamano
2024-09-05 16:45 ` [PATCH v3] " Shubham Kanodia via GitGitGadget
2024-09-05 19:43 ` [PATCH v4] " Shubham Kanodia via GitGitGadget
2024-09-05 20:57 ` Junio C Hamano
2024-09-06 9:42 ` Shubham Kanodia
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=e8232cdc-7a5d-485e-84f7-2c05e17f9907@gmail.com \
--to=stolee@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=ps@pks.im \
--cc=shubham.kanodia10@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).