{"thread":{"id":"62057","subject":"[PATCH] remote: prefetch config","startedAt":"2024-09-04T18:00:04Z","lastAt":"2024-09-06T09:42:45Z","messageCount":16,"participants":["Shubham Kanodia via GitGitGadget","Derrick Stolee","Junio C Hamano","Shubham Kanodia"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"502158","messageId":"pull.1779.git.1725472799637.gitgitgadget@gmail.com","threadId":"62057","inReplyTo":null,"subject":"[PATCH] remote: prefetch config","fromName":"Shubham Kanodia via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-09-04T17:59:59Z","receivedAt":"2024-09-04T18:00:04Z","isPatch":true,"sender":{"key":"shubham.kanodia10@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8946207?v=4"},"body":"From: Shubham Kanodia <shubham.kanodia10@gmail.com>\n\nLarge repositories often contain numerous branches and refs, many of\nwhich individual users may not need. This commit introduces a new\nconfiguration option (`remote.<remote>.prefetch`) to allow\nusers to specify which remotes to prefetch during\nthe maintenance task.\n\nKey behaviors:\n1. If `remote.<remote>.prefetch` is unset or true, running\n   `git-maintenance` will prefetch all refs for the remote.\n2. If `remote.<remote>.prefetch` is set to false, the remote\n   will be ignored for prefetching.\n\nIn a future change, we could also allow restricting the refs that are\nprefetched per remote using the `prefetchref` config option per remote.\n\nBoth of these options in unison would allow users to optimize their\nprefetch operations, reducing network traffic and disk usage.\n\nSigned-off-by: Shubham Kanodia <shubham.kanodia10@gmail.com>\n---\n    remote: prefetch config\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1779%2Fpastelsky%2Fsk%2Fmaintenance-prefetch-remote-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1779/pastelsky/sk/maintenance-prefetch-remote-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1779\n\n Documentation/config/remote.txt   |  5 +++\n Documentation/git-maintenance.txt |  7 +++--\n builtin/gc.c                      |  3 ++\n remote.c                          |  3 ++\n remote.h                          |  9 ++++++\n t/t7900-maintenance.sh            | 51 +++++++++++++++++++++++++++++++\n 6 files changed, 75 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/config/remote.txt b/Documentation/config/remote.txt\nindex 8efc53e836d..c2b3876192c 100644\n--- a/Documentation/config/remote.txt\n+++ b/Documentation/config/remote.txt\n@@ -33,6 +33,11 @@ remote.<name>.fetch::\n \tThe default set of \"refspec\" for linkgit:git-fetch[1]. See\n \tlinkgit:git-fetch[1].\n \n+remote.<name>.prefetch::\n+\tIf false, refs from the remote would not be prefetched for\n+\tthe prefetch task in linkgit:git-maintenance[1]. If not set,\n+\tthe value is assumed to be true.\n+\n remote.<name>.push::\n \tThe default set of \"refspec\" for linkgit:git-push[1]. See\n \tlinkgit:git-push[1].\ndiff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt\nindex 51d0f7e94b6..2fd38706ea2 100644\n--- a/Documentation/git-maintenance.txt\n+++ b/Documentation/git-maintenance.txt\n@@ -97,9 +97,10 @@ commit-graph::\n \n prefetch::\n \tThe `prefetch` task updates the object directory with the latest\n-\tobjects from all registered remotes. For each remote, a `git fetch`\n-\tcommand is run. The configured refspec is modified to place all\n-\trequested refs within `refs/prefetch/`. Also, tags are not updated.\n+\tobjects from all registered remotes unless they've disabled prefetch\n+\tusing `remote.<remote>.prefetch` set to `false`. For each such remote,\n+\ta `git fetch` command is run. The configured refspec is modified to place\n+\tall requested refs within `refs/prefetch/`. Also, tags are not updated.\n +\n This is done to avoid disrupting the remote-tracking branches. The end users\n expect these refs to stay unmoved unless they initiate a fetch.  However,\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 427faf1cfe1..88b8d80aff6 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -1027,6 +1027,9 @@ static int fetch_remote(struct remote *remote, void *cbdata)\n \tif (remote->skip_default_update)\n \t\treturn 0;\n \n+\tif (remote->prefetch == 0)\n+\t\treturn 0;\n+\n \tchild.git_cmd = 1;\n \tstrvec_pushl(&child.args, \"fetch\", remote->name,\n \t\t     \"--prefetch\", \"--prune\", \"--no-tags\",\ndiff --git a/remote.c b/remote.c\nindex 8f3dee13186..05edb3a5f40 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -140,6 +140,7 @@ static struct remote *make_remote(struct remote_state *remote_state,\n \tCALLOC_ARRAY(ret, 1);\n \tret->prune = -1;  /* unspecified */\n \tret->prune_tags = -1;  /* unspecified */\n+\tret->prefetch = -1;  /* unspecified */\n \tret->name = xstrndup(name, len);\n \trefspec_init(&ret->push, REFSPEC_PUSH);\n \trefspec_init(&ret->fetch, REFSPEC_FETCH);\n@@ -456,6 +457,8 @@ static int handle_config(const char *key, const char *value,\n \t\tremote->prune = git_config_bool(key, value);\n \telse if (!strcmp(subkey, \"prunetags\"))\n \t\tremote->prune_tags = git_config_bool(key, value);\n+\telse if (!strcmp(subkey, \"prefetch\"))\n+\t\tremote->prefetch = git_config_bool(key, value);\n \telse if (!strcmp(subkey, \"url\")) {\n \t\tif (!value)\n \t\t\treturn config_error_nonbool(key);\ndiff --git a/remote.h b/remote.h\nindex b901b56746d..57d21a7bfe7 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -77,6 +77,15 @@ struct remote {\n \n \tstruct refspec fetch;\n \n+\t/*\n+\t * This setting for whether to prefetch from a remote\n+\t * when a fetch is invoked with a prefetch flag.\n+\t *  -1 = unset\n+\t *   0 = don't prefetch from this remote\n+\t *   1 = prefetch from this remote\n+\t */\n+\tint prefetch;\n+\n \t/*\n \t * The setting for whether to fetch tags (as a separate rule from the\n \t * configured refspecs);\ndiff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh\nindex abae7a97546..7bc349ec546 100755\n--- a/t/t7900-maintenance.sh\n+++ b/t/t7900-maintenance.sh\n@@ -245,6 +245,57 @@ test_expect_success 'prefetch multiple remotes' '\n \ttest_subcommand git fetch remote2 $fetchargs <skip-remote1.txt\n '\n \n+test_expect_success 'prefetch respects remote.*.prefetch config' '\n+\ttest_create_repo prefetch-test-config &&\n+\t(\n+\t\tcd prefetch-test-config &&\n+\t\ttest_commit initial &&\n+\t\ttest_create_repo clone1 &&\n+\t\ttest_create_repo clone2 &&\n+\t\ttest_create_repo clone3 &&\n+\n+\t\tgit remote add remote1 \"file://$(pwd)/clone1\" &&\n+\t\tgit remote add remote2 \"file://$(pwd)/clone2\" &&\n+\t\tgit remote add remote3 \"file://$(pwd)/clone3\" &&\n+\n+\t\tgit config remote.remote1.prefetch false &&\n+\t\tgit config remote.remote2.prefetch true &&\n+\t\t# remote3 is left unset\n+\n+\t\t# Make changes in all clones\n+\t\tgit -C clone1 switch -c one &&\n+\t\tgit -C clone2 switch -c two &&\n+\t\tgit -C clone3 switch -c three &&\n+\t\ttest_commit -C clone1 one &&\n+\t\ttest_commit -C clone2 two &&\n+\t\ttest_commit -C clone3 three &&\n+\n+\t\t# Run maintenance prefetch task\n+\t\tGIT_TRACE2_EVENT=\"$(pwd)/prefetch.txt\" git maintenance run --task=prefetch 2>/dev/null &&\n+\n+\t\t# Check that remote1 was not fetched (prefetch=false)\n+\t\ttest_subcommand ! git fetch remote1 --prefetch --prune --no-tags \\\n+\t\t\t--no-write-fetch-head --recurse-submodules=no --quiet \\\n+\t\t\t<prefetch.txt &&\n+\n+\t\t# Check that remote2 was fetched (prefetch=true)\n+\t\ttest_subcommand git fetch remote2 --prefetch --prune --no-tags \\\n+\t\t\t--no-write-fetch-head --recurse-submodules=no --quiet \\\n+\t\t\t<prefetch.txt &&\n+\n+\t\t# Check that remote3 was fetched (prefetch unset, default to true)\n+\t\ttest_subcommand git fetch remote3 --prefetch --prune --no-tags \\\n+\t\t\t--no-write-fetch-head --recurse-submodules=no --quiet \\\n+\t\t\t<prefetch.txt &&\n+\n+\t\t# Verify that changes are in the prefetch refs for remote2 and remote3, but not remote1\n+\t\ttest_must_fail git rev-parse refs/prefetch/remotes/remote1/one &&\n+\t\tgit fetch --all &&\n+\t\ttest_cmp_rev refs/remotes/remote2/two refs/prefetch/remotes/remote2/two &&\n+\t\ttest_cmp_rev refs/remotes/remote3/three refs/prefetch/remotes/remote3/three\n+\t)\n+'\n+\n test_expect_success 'loose-objects task' '\n \t# Repack everything so we know the state of the object dir\n \tgit repack -adk &&\n\nbase-commit: 2e7b89e038c0c888acf61f1b4ee5a43d4dd5e94c\n-- \ngitgitgadget\n"},{"id":"502171","messageId":"e8232cdc-7a5d-485e-84f7-2c05e17f9907@gmail.com","threadId":"62057","inReplyTo":"pull.1779.git.1725472799637.gitgitgadget@gmail.com","subject":"Re: [PATCH] remote: prefetch config","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2024-09-04T20:03:34Z","receivedAt":"2024-09-04T20:03:37Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 9/4/24 1:59 PM, Shubham Kanodia via GitGitGadget wrote:\n> From: Shubham Kanodia <shubham.kanodia10@gmail.com>\n> \n> Large repositories often contain numerous branches and refs, many of\n> which individual users may not need. This commit introduces a new\n> configuration option (`remote.<remote>.prefetch`) to allow\n> users to specify which remotes to prefetch during\n> the maintenance task.\n> \n> Key behaviors:\n> 1. If `remote.<remote>.prefetch` is unset or true, running\n>     `git-maintenance` will prefetch all refs for the remote.\n> 2. If `remote.<remote>.prefetch` is set to false, the remote\n>     will be ignored for prefetching.\n\nThanks for this contribution. I think this is a good idea for extra\nflexibility of the prefetch task.\n\n> In a future change, we could also allow restricting the refs that are\n> prefetched per remote using the `prefetchref` config option per remote.\n\nI agree that this would also be of interest, but more complicated. Thanks\nfor starting with this simpler modification.\n\n> +\tif (remote->prefetch == 0)\n> +\t\treturn 0;\n\nIn the Git codebase, this would normally be written as\n\n\tif (!remote->prefetch)\n\t\treturn 0;\n\n> +\t\t# Run maintenance prefetch task\n> +\t\tGIT_TRACE2_EVENT=\"$(pwd)/prefetch.txt\" git maintenance run --task=prefetch 2>/dev/null &&\n> +\n> +\t\t# Check that remote1 was not fetched (prefetch=false)\n> +\t\ttest_subcommand ! git fetch remote1 --prefetch --prune --no-tags \\\n> +\t\t\t--no-write-fetch-head --recurse-submodules=no --quiet \\\n> +\t\t\t<prefetch.txt &&\n\nI'm happy to see this use of test_subcommand to validate the behavior\nof this patch!\n\nThis is a very good patch and I only have the one style nit.\n\nThanks,\n-Stolee\n"},{"id":"502173","messageId":"xmqqfrqf87gb.fsf@gitster.g","threadId":"62057","inReplyTo":"e8232cdc-7a5d-485e-84f7-2c05e17f9907@gmail.com","subject":"Re: [PATCH] remote: prefetch config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-09-04T20:55:32Z","receivedAt":"2024-09-04T20:55:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Derrick Stolee <stolee@gmail.com> writes:\n\n> I agree that this would also be of interest, but more complicated. Thanks\n> for starting with this simpler modification.\n>\n>> +\tif (remote->prefetch == 0)\n>> +\t\treturn 0;\n>\n> In the Git codebase, this would normally be written as\n>\n> \tif (!remote->prefetch)\n> \t\treturn 0;\n\n;-)\n\n>> +\t\t# Run maintenance prefetch task\n>> +\t\tGIT_TRACE2_EVENT=\"$(pwd)/prefetch.txt\" git maintenance run --task=prefetch 2>/dev/null &&\n>> +\n>> +\t\t# Check that remote1 was not fetched (prefetch=false)\n>> +\t\ttest_subcommand ! git fetch remote1 --prefetch --prune --no-tags \\\n>> +\t\t\t--no-write-fetch-head --recurse-submodules=no --quiet \\\n>> +\t\t\t<prefetch.txt &&\n>\n> I'm happy to see this use of test_subcommand to validate the behavior\n> of this patch!\n\nI found it a bit disturbing that the pattern is overly specific.\n\nThe only thing we are interested in is that we are not fetching from\nremote1, so it _should_ suffice if we could write\n\n\ttest_subcommand ! git fetch remote1 <prefetch.txt &&\n\nto avoid being tied to how the current version of Git happens to\npass these command line option flags and the order it does so.\n\nLooking at the implementation of test_subcommand, it seems that we\ncannot quite do that (it assumes that the pattern it assembles out\nof the parameters are to match the full argument list used in\ninvocation, enclosing them in a single [] pair and without giving\nthe caller an easy way to sneak wildcards like \".*\" in), which is\nsad.\n\n\nSo, the expected command line being too strit is *not* a fault of\nthis patch, and with the style fix, I think this half of the\nsolution is a good one.\n\nThanks.\n"},{"id":"502187","messageId":"52f6da10-e39a-4a2d-bd9a-5739a49235c2@gmail.com","threadId":"62057","inReplyTo":"xmqqfrqf87gb.fsf@gitster.g","subject":"Re: [PATCH] remote: prefetch config","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2024-09-05T02:08:44Z","receivedAt":"2024-09-05T02:08:46Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 9/4/24 4:55 PM, Junio C Hamano wrote:\n> Derrick Stolee <stolee@gmail.com> writes:\n\n>>> +\t\t# Run maintenance prefetch task\n>>> +\t\tGIT_TRACE2_EVENT=\"$(pwd)/prefetch.txt\" git maintenance run --task=prefetch 2>/dev/null &&\n>>> +\n>>> +\t\t# Check that remote1 was not fetched (prefetch=false)\n>>> +\t\ttest_subcommand ! git fetch remote1 --prefetch --prune --no-tags \\\n>>> +\t\t\t--no-write-fetch-head --recurse-submodules=no --quiet \\\n>>> +\t\t\t<prefetch.txt &&\n>>\n>> I'm happy to see this use of test_subcommand to validate the behavior\n>> of this patch!\n> \n> I found it a bit disturbing that the pattern is overly specific.\n> \n> The only thing we are interested in is that we are not fetching from\n> remote1, so it _should_ suffice if we could write\n> \n> \ttest_subcommand ! git fetch remote1 <prefetch.txt &&\n> \n> to avoid being tied to how the current version of Git happens to\n> pass these command line option flags and the order it does so.\n> \n> Looking at the implementation of test_subcommand, it seems that we\n> cannot quite do that (it assumes that the pattern it assembles out\n> of the parameters are to match the full argument list used in\n> invocation, enclosing them in a single [] pair and without giving\n> the caller an easy way to sneak wildcards like \".*\" in), which is\n> sad.\nI agree the ergonomics of the test_subcommand helper is a bit poor\n(and not this patch author's fault). The trickiest part is the\nnegative case, as in this highlighted one. It's hard to read from\nthis if the subcommand wasn't found because the argument list is\ntoo specific and doesn't match the exact arguments.\n\nIt helps that the same options are given for the other, positive\ntests. But maybe that could be a hint as to how to make this test\na bit cleaner: make a variable describing the \"uninteresting\"\narguments. Something like...\n\n\targs=\"--prefetch --prune --no-tags \\\n  \t      --no-write-fetch-head --recurse-submodules=no --quiet\" &&\n\n\ttest_subcommand ! git fetch remote1 $args <prefetch.txt &&\n\ttest_subcommand git fetch remote2 $args <prefetch.txt &&\n\ttest_subcommand git fetch remote3 $args <prefetch.txt &&\n\nThanks,\n-Stolee\n\n"},{"id":"502188","messageId":"CAG=Um+1P8+SJa5aYhuuQ0fVgB0kis0MzMA94oRoBm=SNtROi+w@mail.gmail.com","threadId":"62057","inReplyTo":"52f6da10-e39a-4a2d-bd9a-5739a49235c2@gmail.com","subject":"Re: [PATCH] remote: prefetch config","fromName":"Shubham Kanodia","fromEmail":"shubham.kanodia10@gmail.com","sentAt":"2024-09-05T02:51:18Z","receivedAt":"2024-09-05T02:51:55Z","isPatch":true,"sender":{"key":"shubham.kanodia10@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8946207?v=4"},"body":"On Thu, Sep 5, 2024 at 7:38 AM Derrick Stolee <stolee@gmail.com> wrote:\n>\n> On 9/4/24 4:55 PM, Junio C Hamano wrote:\n> > Derrick Stolee <stolee@gmail.com> writes:\n>\n> >>> +           # Run maintenance prefetch task\n> >>> +           GIT_TRACE2_EVENT=\"$(pwd)/prefetch.txt\" git maintenance run --task=prefetch 2>/dev/null &&\n> >>> +\n> >>> +           # Check that remote1 was not fetched (prefetch=false)\n> >>> +           test_subcommand ! git fetch remote1 --prefetch --prune --no-tags \\\n> >>> +                   --no-write-fetch-head --recurse-submodules=no --quiet \\\n> >>> +                   <prefetch.txt &&\n> >>\n> >> I'm happy to see this use of test_subcommand to validate the behavior\n> >> of this patch!\n> >\n> > I found it a bit disturbing that the pattern is overly specific.\n> >\n> > The only thing we are interested in is that we are not fetching from\n> > remote1, so it _should_ suffice if we could write\n> >\n> >       test_subcommand ! git fetch remote1 <prefetch.txt &&\n> >\n> > to avoid being tied to how the current version of Git happens to\n> > pass these command line option flags and the order it does so.\n> >\n> > Looking at the implementation of test_subcommand, it seems that we\n> > cannot quite do that (it assumes that the pattern it assembles out\n> > of the parameters are to match the full argument list used in\n> > invocation, enclosing them in a single [] pair and without giving\n> > the caller an easy way to sneak wildcards like \".*\" in), which is\n> > sad.\n> I agree the ergonomics of the test_subcommand helper is a bit poor\n> (and not this patch author's fault). The trickiest part is the\n> negative case, as in this highlighted one. It's hard to read from\n> this if the subcommand wasn't found because the argument list is\n> too specific and doesn't match the exact arguments.\n>\n> It helps that the same options are given for the other, positive\n> tests. But maybe that could be a hint as to how to make this test\n> a bit cleaner: make a variable describing the \"uninteresting\"\n> arguments. Something like...\n>\n>         args=\"--prefetch --prune --no-tags \\\n>               --no-write-fetch-head --recurse-submodules=no --quiet\" &&\n>\n>         test_subcommand ! git fetch remote1 $args <prefetch.txt &&\n>         test_subcommand git fetch remote2 $args <prefetch.txt &&\n>         test_subcommand git fetch remote3 $args <prefetch.txt &&\n>\n> Thanks,\n> -Stolee\n>\n\nAgree with both the suggestions here. Updated my patch.\n"},{"id":"502189","messageId":"pull.1779.v2.git.1725504725976.gitgitgadget@gmail.com","threadId":"62057","inReplyTo":"pull.1779.git.1725472799637.gitgitgadget@gmail.com","subject":"[PATCH v2] remote: prefetch config","fromName":"Shubham Kanodia via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-09-05T02:52:05Z","receivedAt":"2024-09-05T02:52:10Z","isPatch":true,"sender":{"key":"shubham.kanodia10@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8946207?v=4"},"body":"From: Shubham Kanodia <shubham.kanodia10@gmail.com>\n\nLarge repositories often contain numerous branches and refs, many of\nwhich individual users may not need. This commit introduces a new\nconfiguration option (`remote.<remote>.prefetch`) to allow\nusers to specify which remotes to prefetch during\nthe maintenance task.\n\nKey behaviors:\n1. If `remote.<remote>.prefetch` is unset or true, running\n   `git-maintenance` will prefetch all refs for the remote.\n2. If `remote.<remote>.prefetch` is set to false, the remote\n   will be ignored for prefetching.\n\nIn a future change, we could also allow restricting the refs that are\nprefetched per remote using the `prefetchref` config option per remote.\n\nBoth of these options in unison would allow users to optimize their\nprefetch operations, reducing network traffic and disk usage.\n\nSigned-off-by: Shubham Kanodia <shubham.kanodia10@gmail.com>\n---\n    remote: prefetch config\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1779%2Fpastelsky%2Fsk%2Fmaintenance-prefetch-remote-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1779/pastelsky/sk/maintenance-prefetch-remote-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/1779\n\nRange-diff vs v1:\n\n 1:  667553b114b ! 1:  1d58b782e22 remote: prefetch config\n     @@ builtin/gc.c: static int fetch_remote(struct remote *remote, void *cbdata)\n       \tif (remote->skip_default_update)\n       \t\treturn 0;\n       \n     -+\tif (remote->prefetch == 0)\n     ++\tif (!remote->prefetch)\n      +\t\treturn 0;\n      +\n       \tchild.git_cmd = 1;\n     @@ remote.h: struct remote {\n       \tstruct refspec fetch;\n       \n      +\t/*\n     -+\t * This setting for whether to prefetch from a remote\n     ++\t * The setting for whether to prefetch from a remote\n      +\t * when a fetch is invoked with a prefetch flag.\n      +\t *  -1 = unset\n      +\t *   0 = don't prefetch from this remote\n     @@ t/t7900-maintenance.sh: test_expect_success 'prefetch multiple remotes' '\n      +\t\t# Run maintenance prefetch task\n      +\t\tGIT_TRACE2_EVENT=\"$(pwd)/prefetch.txt\" git maintenance run --task=prefetch 2>/dev/null &&\n      +\n     -+\t\t# Check that remote1 was not fetched (prefetch=false)\n     -+\t\ttest_subcommand ! git fetch remote1 --prefetch --prune --no-tags \\\n     -+\t\t\t--no-write-fetch-head --recurse-submodules=no --quiet \\\n     -+\t\t\t<prefetch.txt &&\n     -+\n     -+\t\t# Check that remote2 was fetched (prefetch=true)\n     -+\t\ttest_subcommand git fetch remote2 --prefetch --prune --no-tags \\\n     -+\t\t\t--no-write-fetch-head --recurse-submodules=no --quiet \\\n     -+\t\t\t<prefetch.txt &&\n     -+\n     -+\t\t# Check that remote3 was fetched (prefetch unset, default to true)\n     -+\t\ttest_subcommand git fetch remote3 --prefetch --prune --no-tags \\\n     -+\t\t\t--no-write-fetch-head --recurse-submodules=no --quiet \\\n     -+\t\t\t<prefetch.txt &&\n     ++\t\t# Check that if remotes were prefetched properly\n     ++\t\tfetchargs=\"--prefetch --prune --no-tags --no-write-fetch-head --recurse-submodules=no --quiet\" &&\n     ++\t\ttest_subcommand ! git fetch remote1 $fetchargs <prefetch.txt &&\n     ++\t\ttest_subcommand git fetch remote2 $fetchargs <prefetch.txt &&\n     ++\t\ttest_subcommand git fetch remote3 $fetchargs <prefetch.txt &&\n      +\n      +\t\t# Verify that changes are in the prefetch refs for remote2 and remote3, but not remote1\n      +\t\ttest_must_fail git rev-parse refs/prefetch/remotes/remote1/one &&\n\n\n Documentation/config/remote.txt   |  5 ++++\n Documentation/git-maintenance.txt |  7 +++---\n builtin/gc.c                      |  3 +++\n remote.c                          |  3 +++\n remote.h                          |  9 +++++++\n t/t7900-maintenance.sh            | 42 +++++++++++++++++++++++++++++++\n 6 files changed, 66 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/config/remote.txt b/Documentation/config/remote.txt\nindex 8efc53e836d..c2b3876192c 100644\n--- a/Documentation/config/remote.txt\n+++ b/Documentation/config/remote.txt\n@@ -33,6 +33,11 @@ remote.<name>.fetch::\n \tThe default set of \"refspec\" for linkgit:git-fetch[1]. See\n \tlinkgit:git-fetch[1].\n \n+remote.<name>.prefetch::\n+\tIf false, refs from the remote would not be prefetched for\n+\tthe prefetch task in linkgit:git-maintenance[1]. If not set,\n+\tthe value is assumed to be true.\n+\n remote.<name>.push::\n \tThe default set of \"refspec\" for linkgit:git-push[1]. See\n \tlinkgit:git-push[1].\ndiff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt\nindex 51d0f7e94b6..2fd38706ea2 100644\n--- a/Documentation/git-maintenance.txt\n+++ b/Documentation/git-maintenance.txt\n@@ -97,9 +97,10 @@ commit-graph::\n \n prefetch::\n \tThe `prefetch` task updates the object directory with the latest\n-\tobjects from all registered remotes. For each remote, a `git fetch`\n-\tcommand is run. The configured refspec is modified to place all\n-\trequested refs within `refs/prefetch/`. Also, tags are not updated.\n+\tobjects from all registered remotes unless they've disabled prefetch\n+\tusing `remote.<remote>.prefetch` set to `false`. For each such remote,\n+\ta `git fetch` command is run. The configured refspec is modified to place\n+\tall requested refs within `refs/prefetch/`. Also, tags are not updated.\n +\n This is done to avoid disrupting the remote-tracking branches. The end users\n expect these refs to stay unmoved unless they initiate a fetch.  However,\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 427faf1cfe1..2ca3a3e7d6a 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -1027,6 +1027,9 @@ static int fetch_remote(struct remote *remote, void *cbdata)\n \tif (remote->skip_default_update)\n \t\treturn 0;\n \n+\tif (!remote->prefetch)\n+\t\treturn 0;\n+\n \tchild.git_cmd = 1;\n \tstrvec_pushl(&child.args, \"fetch\", remote->name,\n \t\t     \"--prefetch\", \"--prune\", \"--no-tags\",\ndiff --git a/remote.c b/remote.c\nindex 8f3dee13186..05edb3a5f40 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -140,6 +140,7 @@ static struct remote *make_remote(struct remote_state *remote_state,\n \tCALLOC_ARRAY(ret, 1);\n \tret->prune = -1;  /* unspecified */\n \tret->prune_tags = -1;  /* unspecified */\n+\tret->prefetch = -1;  /* unspecified */\n \tret->name = xstrndup(name, len);\n \trefspec_init(&ret->push, REFSPEC_PUSH);\n \trefspec_init(&ret->fetch, REFSPEC_FETCH);\n@@ -456,6 +457,8 @@ static int handle_config(const char *key, const char *value,\n \t\tremote->prune = git_config_bool(key, value);\n \telse if (!strcmp(subkey, \"prunetags\"))\n \t\tremote->prune_tags = git_config_bool(key, value);\n+\telse if (!strcmp(subkey, \"prefetch\"))\n+\t\tremote->prefetch = git_config_bool(key, value);\n \telse if (!strcmp(subkey, \"url\")) {\n \t\tif (!value)\n \t\t\treturn config_error_nonbool(key);\ndiff --git a/remote.h b/remote.h\nindex b901b56746d..4522fdec354 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -77,6 +77,15 @@ struct remote {\n \n \tstruct refspec fetch;\n \n+\t/*\n+\t * The setting for whether to prefetch from a remote\n+\t * when a fetch is invoked with a prefetch flag.\n+\t *  -1 = unset\n+\t *   0 = don't prefetch from this remote\n+\t *   1 = prefetch from this remote\n+\t */\n+\tint prefetch;\n+\n \t/*\n \t * The setting for whether to fetch tags (as a separate rule from the\n \t * configured refspecs);\ndiff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh\nindex abae7a97546..7484e1f1d46 100755\n--- a/t/t7900-maintenance.sh\n+++ b/t/t7900-maintenance.sh\n@@ -245,6 +245,48 @@ test_expect_success 'prefetch multiple remotes' '\n \ttest_subcommand git fetch remote2 $fetchargs <skip-remote1.txt\n '\n \n+test_expect_success 'prefetch respects remote.*.prefetch config' '\n+\ttest_create_repo prefetch-test-config &&\n+\t(\n+\t\tcd prefetch-test-config &&\n+\t\ttest_commit initial &&\n+\t\ttest_create_repo clone1 &&\n+\t\ttest_create_repo clone2 &&\n+\t\ttest_create_repo clone3 &&\n+\n+\t\tgit remote add remote1 \"file://$(pwd)/clone1\" &&\n+\t\tgit remote add remote2 \"file://$(pwd)/clone2\" &&\n+\t\tgit remote add remote3 \"file://$(pwd)/clone3\" &&\n+\n+\t\tgit config remote.remote1.prefetch false &&\n+\t\tgit config remote.remote2.prefetch true &&\n+\t\t# remote3 is left unset\n+\n+\t\t# Make changes in all clones\n+\t\tgit -C clone1 switch -c one &&\n+\t\tgit -C clone2 switch -c two &&\n+\t\tgit -C clone3 switch -c three &&\n+\t\ttest_commit -C clone1 one &&\n+\t\ttest_commit -C clone2 two &&\n+\t\ttest_commit -C clone3 three &&\n+\n+\t\t# Run maintenance prefetch task\n+\t\tGIT_TRACE2_EVENT=\"$(pwd)/prefetch.txt\" git maintenance run --task=prefetch 2>/dev/null &&\n+\n+\t\t# Check that if remotes were prefetched properly\n+\t\tfetchargs=\"--prefetch --prune --no-tags --no-write-fetch-head --recurse-submodules=no --quiet\" &&\n+\t\ttest_subcommand ! git fetch remote1 $fetchargs <prefetch.txt &&\n+\t\ttest_subcommand git fetch remote2 $fetchargs <prefetch.txt &&\n+\t\ttest_subcommand git fetch remote3 $fetchargs <prefetch.txt &&\n+\n+\t\t# Verify that changes are in the prefetch refs for remote2 and remote3, but not remote1\n+\t\ttest_must_fail git rev-parse refs/prefetch/remotes/remote1/one &&\n+\t\tgit fetch --all &&\n+\t\ttest_cmp_rev refs/remotes/remote2/two refs/prefetch/remotes/remote2/two &&\n+\t\ttest_cmp_rev refs/remotes/remote3/three refs/prefetch/remotes/remote3/three\n+\t)\n+'\n+\n test_expect_success 'loose-objects task' '\n \t# Repack everything so we know the state of the object dir\n \tgit repack -adk &&\n\nbase-commit: 2e7b89e038c0c888acf61f1b4ee5a43d4dd5e94c\n-- \ngitgitgadget\n"},{"id":"502241","messageId":"xmqqtteu5eof.fsf@gitster.g","threadId":"62057","inReplyTo":"52f6da10-e39a-4a2d-bd9a-5739a49235c2@gmail.com","subject":"Re: [PATCH] remote: prefetch config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-09-05T15:00:00Z","receivedAt":"2024-09-05T15:00:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Derrick Stolee <stolee@gmail.com> writes:\n\n> On 9/4/24 4:55 PM, Junio C Hamano wrote:\n>> Derrick Stolee <stolee@gmail.com> writes:\n>\n>>>> +\t\t# Run maintenance prefetch task\n>>>> +\t\tGIT_TRACE2_EVENT=\"$(pwd)/prefetch.txt\" git maintenance run --task=prefetch 2>/dev/null &&\n>>>> +\n>>>> +\t\t# Check that remote1 was not fetched (prefetch=false)\n>>>> +\t\ttest_subcommand ! git fetch remote1 --prefetch --prune --no-tags \\\n>>>> +\t\t\t--no-write-fetch-head --recurse-submodules=no --quiet \\\n>>>> +\t\t\t<prefetch.txt &&\n>>>\n>>> I'm happy to see this use of test_subcommand to validate the behavior\n>>> of this patch!\n>> I found it a bit disturbing that the pattern is overly specific.\n>> The only thing we are interested in is that we are not fetching from\n>> remote1, so it _should_ suffice if we could write\n>> \ttest_subcommand ! git fetch remote1 <prefetch.txt &&\n>> to avoid being tied to how the current version of Git happens to\n>> pass these command line option flags and the order it does so.\n>> Looking at the implementation of test_subcommand, it seems that we\n>> cannot quite do that (it assumes that the pattern it assembles out\n>> of the parameters are to match the full argument list used in\n>> invocation, enclosing them in a single [] pair and without giving\n>> the caller an easy way to sneak wildcards like \".*\" in), which is\n>> sad.\n> I agree the ergonomics of the test_subcommand helper is a bit poor\n> (and not this patch author's fault).\n\nI suspect that we could do\n\n    test_subcommand ! git fetch remote1 --prefetch '.*' <prefetch.txt\n\nwhich would be rewritten to this pattern\n\n\t\\[\"git\", \"fetch\", \"remote1\", \"--prefetch\", \".*\"\\]\n\nif I am reading how the expr given to grep is built by the\ntest_subcommand implementation.  As long a there is at least one\nactual argument after the \"--prefetch\" one, .* would slurp\neverything.\n\nBut it is ugly.  In any case, this is a tangent unrelated to the\ntopic of the patch on this thread.\n"},{"id":"502254","messageId":"xmqqcyli3x1w.fsf@gitster.g","threadId":"62057","inReplyTo":"pull.1779.v2.git.1725504725976.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] remote: prefetch config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-09-05T16:06:03Z","receivedAt":"2024-09-05T16:06:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shubham Kanodia via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> diff --git a/builtin/gc.c b/builtin/gc.c\n> index 427faf1cfe1..2ca3a3e7d6a 100644\n> --- a/builtin/gc.c\n> +++ b/builtin/gc.c\n> @@ -1027,6 +1027,9 @@ static int fetch_remote(struct remote *remote, void *cbdata)\n>  \tif (remote->skip_default_update)\n>  \t\treturn 0;\n>  \n> +\tif (!remote->prefetch)\n> +\t\treturn 0;\n\nThis, while better than ane xplicit comparison with \"== 0\", is a bit\ntricky in this patch, as it is not saying \"if we are told to prefetch,\nfall through to the rest of the function\".  It is saying \"leave if\nand only if we are explicitly configured not to prefetch\".\n\nIt might warrant a comment.\n\n> diff --git a/remote.c b/remote.c\n> index 8f3dee13186..05edb3a5f40 100644\n> --- a/remote.c\n> +++ b/remote.c\n> @@ -140,6 +140,7 @@ static struct remote *make_remote(struct remote_state *remote_state,\n>  \tCALLOC_ARRAY(ret, 1);\n>  \tret->prune = -1;  /* unspecified */\n>  \tret->prune_tags = -1;  /* unspecified */\n> +\tret->prefetch = -1;  /* unspecified */\n\nOr, we can just assign \"1\" (and drop \"unspecified\" comment).\n\n\tret->prefetch = 1; /* enabled by default */\n\nIf I understand it correctly, we want this to default to true...\n\n>  \tret->name = xstrndup(name, len);\n>  \trefspec_init(&ret->push, REFSPEC_PUSH);\n>  \trefspec_init(&ret->fetch, REFSPEC_FETCH);\n> @@ -456,6 +457,8 @@ static int handle_config(const char *key, const char *value,\n>  \t\tremote->prune = git_config_bool(key, value);\n>  \telse if (!strcmp(subkey, \"prunetags\"))\n>  \t\tremote->prune_tags = git_config_bool(key, value);\n> +\telse if (!strcmp(subkey, \"prefetch\"))\n> +\t\tremote->prefetch = git_config_bool(key, value);\n\n... with a way for the user to turn it off.\n\n> diff --git a/remote.h b/remote.h\n> index b901b56746d..4522fdec354 100644\n> --- a/remote.h\n> +++ b/remote.h\n> @@ -77,6 +77,15 @@ struct remote {\n>  \n>  \tstruct refspec fetch;\n>  \n> +\t/*\n> +\t * The setting for whether to prefetch from a remote\n> +\t * when a fetch is invoked with a prefetch flag.\n> +\t *  -1 = unset\n> +\t *   0 = don't prefetch from this remote\n> +\t *   1 = prefetch from this remote\n> +\t */\n> +\tint prefetch;\n\nAnd then we can get rid of \"-1 unset\" from this list.  The comment\ncan become a lot more brief, as such a change would make it a simple\nBoolean flag that everybody would understand immediately.\n\n\"prefetch\" in the comment is superfluous, as that is the name of the\nmember anyway.  \"from this remote\" is superfluous, as that is the\npoint of having the member in \"struct remote\" that gives settings\nthat are per-remote.\n\n\tint prefetch; /* is prefetch enabled? */\n\nIf we really want to have \"unspecified yet\" state, what we commonly\ndo is\n\n * to initialize the variable to -1 to signal \"unspecified yet\",\n   which you did in this patch.\n\n * after the configuration reader returns, check if the variable is\n   still -1, and then explicitly reset it to the default value,\n   which your patch does not do.\n\n * the code that uses the variable assumes it is either 0 or 1 and\n   there shoudl be no \"unspecified yet\" value.  It indeed is a bug\n   that the ariable is left unspecified as it is a sign that the\n   code to do previous step was somehow skipped.\n\nBut I do not think it is needed in this case; initializing the\n.prefetch member to whichever is the default should be sufficient.\n\nThanks.\n"},{"id":"502258","messageId":"CAG=Um+0WinvE4CQPTwKdxMxj4xBJ9Z1SBWVrGzTMKM3CbMni0w@mail.gmail.com","threadId":"62057","inReplyTo":"xmqqcyli3x1w.fsf@gitster.g","subject":"Re: [PATCH v2] remote: prefetch config","fromName":"Shubham Kanodia","fromEmail":"shubham.kanodia10@gmail.com","sentAt":"2024-09-05T16:43:19Z","receivedAt":"2024-09-05T16:43:57Z","isPatch":true,"sender":{"key":"shubham.kanodia10@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8946207?v=4"},"body":"On Thu, Sep 5, 2024 at 9:36 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> \"Shubham Kanodia via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n> > diff --git a/builtin/gc.c b/builtin/gc.c\n> > index 427faf1cfe1..2ca3a3e7d6a 100644\n> > --- a/builtin/gc.c\n> > +++ b/builtin/gc.c\n> > @@ -1027,6 +1027,9 @@ static int fetch_remote(struct remote *remote, void *cbdata)\n> >       if (remote->skip_default_update)\n> >               return 0;\n> >\n> > +     if (!remote->prefetch)\n> > +             return 0;\n>\n> This, while better than ane xplicit comparison with \"== 0\", is a bit\n> tricky in this patch, as it is not saying \"if we are told to prefetch,\n> fall through to the rest of the function\".  It is saying \"leave if\n> and only if we are explicitly configured not to prefetch\".\n>\n> It might warrant a comment.\n>\n> > diff --git a/remote.c b/remote.c\n> > index 8f3dee13186..05edb3a5f40 100644\n> > --- a/remote.c\n> > +++ b/remote.c\n> > @@ -140,6 +140,7 @@ static struct remote *make_remote(struct remote_state *remote_state,\n> >       CALLOC_ARRAY(ret, 1);\n> >       ret->prune = -1;  /* unspecified */\n> >       ret->prune_tags = -1;  /* unspecified */\n> > +     ret->prefetch = -1;  /* unspecified */\n>\n> Or, we can just assign \"1\" (and drop \"unspecified\" comment).\n>\n>         ret->prefetch = 1; /* enabled by default */\n>\n> If I understand it correctly, we want this to default to true...\n>\n> >       ret->name = xstrndup(name, len);\n> >       refspec_init(&ret->push, REFSPEC_PUSH);\n> >       refspec_init(&ret->fetch, REFSPEC_FETCH);\n> > @@ -456,6 +457,8 @@ static int handle_config(const char *key, const char *value,\n> >               remote->prune = git_config_bool(key, value);\n> >       else if (!strcmp(subkey, \"prunetags\"))\n> >               remote->prune_tags = git_config_bool(key, value);\n> > +     else if (!strcmp(subkey, \"prefetch\"))\n> > +             remote->prefetch = git_config_bool(key, value);\n>\n> ... with a way for the user to turn it off.\n>\n> > diff --git a/remote.h b/remote.h\n> > index b901b56746d..4522fdec354 100644\n> > --- a/remote.h\n> > +++ b/remote.h\n> > @@ -77,6 +77,15 @@ struct remote {\n> >\n> >       struct refspec fetch;\n> >\n> > +     /*\n> > +      * The setting for whether to prefetch from a remote\n> > +      * when a fetch is invoked with a prefetch flag.\n> > +      *  -1 = unset\n> > +      *   0 = don't prefetch from this remote\n> > +      *   1 = prefetch from this remote\n> > +      */\n> > +     int prefetch;\n>\n> And then we can get rid of \"-1 unset\" from this list.  The comment\n> can become a lot more brief, as such a change would make it a simple\n> Boolean flag that everybody would understand immediately.\n>\n> \"prefetch\" in the comment is superfluous, as that is the name of the\n> member anyway.  \"from this remote\" is superfluous, as that is the\n> point of having the member in \"struct remote\" that gives settings\n> that are per-remote.\n>\n>         int prefetch; /* is prefetch enabled? */\n>\n> If we really want to have \"unspecified yet\" state, what we commonly\n> do is\n>\n>  * to initialize the variable to -1 to signal \"unspecified yet\",\n>    which you did in this patch.\n>\n>  * after the configuration reader returns, check if the variable is\n>    still -1, and then explicitly reset it to the default value,\n>    which your patch does not do.\n>\n>  * the code that uses the variable assumes it is either 0 or 1 and\n>    there shoudl be no \"unspecified yet\" value.  It indeed is a bug\n>    that the ariable is left unspecified as it is a sign that the\n>    code to do previous step was somehow skipped.\n>\n> But I do not think it is needed in this case; initializing the\n> .prefetch member to whichever is the default should be sufficient.\n>\n> Thanks.\n\nFair. I kept the initial value as `unset` as that could be interpreted\nas a special case to do something else in the future — but I agree that keeping\nit initialized to default keeps things clearer for now since such a\ncase doesn't arise.\n\nUpdating my patch — please let me know if there's anything else I can\nimprove here.\n"},{"id":"502259","messageId":"pull.1779.v3.git.1725554758463.gitgitgadget@gmail.com","threadId":"62057","inReplyTo":"pull.1779.v2.git.1725504725976.gitgitgadget@gmail.com","subject":"[PATCH v3] remote: prefetch config","fromName":"Shubham Kanodia via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-09-05T16:45:58Z","receivedAt":"2024-09-05T16:46:02Z","isPatch":true,"sender":{"key":"shubham.kanodia10@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8946207?v=4"},"body":"From: Shubham Kanodia <shubham.kanodia10@gmail.com>\n\nLarge repositories often contain numerous branches and refs, many of\nwhich individual users may not need. This commit introduces a new\nconfiguration option (`remote.<remote>.prefetch`) to allow\nusers to specify which remotes to prefetch during\nthe maintenance task.\n\nKey behaviors:\n1. If `remote.<remote>.prefetch` is unset or true, running\n   `git-maintenance` will prefetch all refs for the remote.\n2. If `remote.<remote>.prefetch` is set to false, the remote\n   will be ignored for prefetching.\n\nIn a future change, we could also allow restricting the refs that are\nprefetched per remote using the `prefetchref` config option per remote.\n\nBoth of these options in unison would allow users to optimize their\nprefetch operations, reducing network traffic and disk usage.\n\nSigned-off-by: Shubham Kanodia <shubham.kanodia10@gmail.com>\n---\n    remote: prefetch config\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1779%2Fpastelsky%2Fsk%2Fmaintenance-prefetch-remote-v3\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1779/pastelsky/sk/maintenance-prefetch-remote-v3\nPull-Request: https://github.com/gitgitgadget/git/pull/1779\n\nRange-diff vs v2:\n\n 1:  1d58b782e22 ! 1:  c348f8efd33 remote: prefetch config\n     @@ remote.c: static struct remote *make_remote(struct remote_state *remote_state,\n       \tCALLOC_ARRAY(ret, 1);\n       \tret->prune = -1;  /* unspecified */\n       \tret->prune_tags = -1;  /* unspecified */\n     -+\tret->prefetch = -1;  /* unspecified */\n     ++\tret->prefetch = 1;\n       \tret->name = xstrndup(name, len);\n       \trefspec_init(&ret->push, REFSPEC_PUSH);\n       \trefspec_init(&ret->fetch, REFSPEC_FETCH);\n     @@ remote.h: struct remote {\n       \n       \tstruct refspec fetch;\n       \n     -+\t/*\n     -+\t * The setting for whether to prefetch from a remote\n     -+\t * when a fetch is invoked with a prefetch flag.\n     -+\t *  -1 = unset\n     -+\t *   0 = don't prefetch from this remote\n     -+\t *   1 = prefetch from this remote\n     -+\t */\n      +\tint prefetch;\n      +\n       \t/*\n\n\n Documentation/config/remote.txt   |  5 ++++\n Documentation/git-maintenance.txt |  7 +++---\n builtin/gc.c                      |  3 +++\n remote.c                          |  3 +++\n remote.h                          |  2 ++\n t/t7900-maintenance.sh            | 42 +++++++++++++++++++++++++++++++\n 6 files changed, 59 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/config/remote.txt b/Documentation/config/remote.txt\nindex 8efc53e836d..c2b3876192c 100644\n--- a/Documentation/config/remote.txt\n+++ b/Documentation/config/remote.txt\n@@ -33,6 +33,11 @@ remote.<name>.fetch::\n \tThe default set of \"refspec\" for linkgit:git-fetch[1]. See\n \tlinkgit:git-fetch[1].\n \n+remote.<name>.prefetch::\n+\tIf false, refs from the remote would not be prefetched for\n+\tthe prefetch task in linkgit:git-maintenance[1]. If not set,\n+\tthe value is assumed to be true.\n+\n remote.<name>.push::\n \tThe default set of \"refspec\" for linkgit:git-push[1]. See\n \tlinkgit:git-push[1].\ndiff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt\nindex 51d0f7e94b6..2fd38706ea2 100644\n--- a/Documentation/git-maintenance.txt\n+++ b/Documentation/git-maintenance.txt\n@@ -97,9 +97,10 @@ commit-graph::\n \n prefetch::\n \tThe `prefetch` task updates the object directory with the latest\n-\tobjects from all registered remotes. For each remote, a `git fetch`\n-\tcommand is run. The configured refspec is modified to place all\n-\trequested refs within `refs/prefetch/`. Also, tags are not updated.\n+\tobjects from all registered remotes unless they've disabled prefetch\n+\tusing `remote.<remote>.prefetch` set to `false`. For each such remote,\n+\ta `git fetch` command is run. The configured refspec is modified to place\n+\tall requested refs within `refs/prefetch/`. Also, tags are not updated.\n +\n This is done to avoid disrupting the remote-tracking branches. The end users\n expect these refs to stay unmoved unless they initiate a fetch.  However,\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 427faf1cfe1..2ca3a3e7d6a 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -1027,6 +1027,9 @@ static int fetch_remote(struct remote *remote, void *cbdata)\n \tif (remote->skip_default_update)\n \t\treturn 0;\n \n+\tif (!remote->prefetch)\n+\t\treturn 0;\n+\n \tchild.git_cmd = 1;\n \tstrvec_pushl(&child.args, \"fetch\", remote->name,\n \t\t     \"--prefetch\", \"--prune\", \"--no-tags\",\ndiff --git a/remote.c b/remote.c\nindex 8f3dee13186..4024018b1d6 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -140,6 +140,7 @@ static struct remote *make_remote(struct remote_state *remote_state,\n \tCALLOC_ARRAY(ret, 1);\n \tret->prune = -1;  /* unspecified */\n \tret->prune_tags = -1;  /* unspecified */\n+\tret->prefetch = 1;\n \tret->name = xstrndup(name, len);\n \trefspec_init(&ret->push, REFSPEC_PUSH);\n \trefspec_init(&ret->fetch, REFSPEC_FETCH);\n@@ -456,6 +457,8 @@ static int handle_config(const char *key, const char *value,\n \t\tremote->prune = git_config_bool(key, value);\n \telse if (!strcmp(subkey, \"prunetags\"))\n \t\tremote->prune_tags = git_config_bool(key, value);\n+\telse if (!strcmp(subkey, \"prefetch\"))\n+\t\tremote->prefetch = git_config_bool(key, value);\n \telse if (!strcmp(subkey, \"url\")) {\n \t\tif (!value)\n \t\t\treturn config_error_nonbool(key);\ndiff --git a/remote.h b/remote.h\nindex b901b56746d..182dc105a5a 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -77,6 +77,8 @@ struct remote {\n \n \tstruct refspec fetch;\n \n+\tint prefetch;\n+\n \t/*\n \t * The setting for whether to fetch tags (as a separate rule from the\n \t * configured refspecs);\ndiff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh\nindex abae7a97546..7484e1f1d46 100755\n--- a/t/t7900-maintenance.sh\n+++ b/t/t7900-maintenance.sh\n@@ -245,6 +245,48 @@ test_expect_success 'prefetch multiple remotes' '\n \ttest_subcommand git fetch remote2 $fetchargs <skip-remote1.txt\n '\n \n+test_expect_success 'prefetch respects remote.*.prefetch config' '\n+\ttest_create_repo prefetch-test-config &&\n+\t(\n+\t\tcd prefetch-test-config &&\n+\t\ttest_commit initial &&\n+\t\ttest_create_repo clone1 &&\n+\t\ttest_create_repo clone2 &&\n+\t\ttest_create_repo clone3 &&\n+\n+\t\tgit remote add remote1 \"file://$(pwd)/clone1\" &&\n+\t\tgit remote add remote2 \"file://$(pwd)/clone2\" &&\n+\t\tgit remote add remote3 \"file://$(pwd)/clone3\" &&\n+\n+\t\tgit config remote.remote1.prefetch false &&\n+\t\tgit config remote.remote2.prefetch true &&\n+\t\t# remote3 is left unset\n+\n+\t\t# Make changes in all clones\n+\t\tgit -C clone1 switch -c one &&\n+\t\tgit -C clone2 switch -c two &&\n+\t\tgit -C clone3 switch -c three &&\n+\t\ttest_commit -C clone1 one &&\n+\t\ttest_commit -C clone2 two &&\n+\t\ttest_commit -C clone3 three &&\n+\n+\t\t# Run maintenance prefetch task\n+\t\tGIT_TRACE2_EVENT=\"$(pwd)/prefetch.txt\" git maintenance run --task=prefetch 2>/dev/null &&\n+\n+\t\t# Check that if remotes were prefetched properly\n+\t\tfetchargs=\"--prefetch --prune --no-tags --no-write-fetch-head --recurse-submodules=no --quiet\" &&\n+\t\ttest_subcommand ! git fetch remote1 $fetchargs <prefetch.txt &&\n+\t\ttest_subcommand git fetch remote2 $fetchargs <prefetch.txt &&\n+\t\ttest_subcommand git fetch remote3 $fetchargs <prefetch.txt &&\n+\n+\t\t# Verify that changes are in the prefetch refs for remote2 and remote3, but not remote1\n+\t\ttest_must_fail git rev-parse refs/prefetch/remotes/remote1/one &&\n+\t\tgit fetch --all &&\n+\t\ttest_cmp_rev refs/remotes/remote2/two refs/prefetch/remotes/remote2/two &&\n+\t\ttest_cmp_rev refs/remotes/remote3/three refs/prefetch/remotes/remote3/three\n+\t)\n+'\n+\n test_expect_success 'loose-objects task' '\n \t# Repack everything so we know the state of the object dir\n \tgit repack -adk &&\n\nbase-commit: 2e7b89e038c0c888acf61f1b4ee5a43d4dd5e94c\n-- \ngitgitgadget\n"},{"id":"502261","messageId":"xmqqy1462gc2.fsf@gitster.g","threadId":"62057","inReplyTo":"CAG=Um+0WinvE4CQPTwKdxMxj4xBJ9Z1SBWVrGzTMKM3CbMni0w@mail.gmail.com","subject":"Re: [PATCH v2] remote: prefetch config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-09-05T16:52:29Z","receivedAt":"2024-09-05T16:52:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shubham Kanodia <shubham.kanodia10@gmail.com> writes:\n\n>>\n>>         int prefetch; /* is prefetch enabled? */\n>>\n> ...\n> Updating my patch — please let me know if there's anything else I can\n> improve here.\n\nRenaming the .prefetch member to .prefetch_enabled would eliminate\nthe need to add any comment on the member in the header file.\n\nThanks.\n"},{"id":"502267","messageId":"CAG=Um+0P8SgWo2sN3St8+PpBneQfDBoqnpnC6uMmYu2YOOaWmQ@mail.gmail.com","threadId":"62057","inReplyTo":"xmqqy1462gc2.fsf@gitster.g","subject":"Re: [PATCH v2] remote: prefetch config","fromName":"Shubham Kanodia","fromEmail":"shubham.kanodia10@gmail.com","sentAt":"2024-09-05T17:19:15Z","receivedAt":"2024-09-05T17:19:53Z","isPatch":true,"sender":{"key":"shubham.kanodia10@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8946207?v=4"},"body":"On Thu, Sep 5, 2024 at 10:22 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Shubham Kanodia <shubham.kanodia10@gmail.com> writes:\n>\n> >>\n> >>         int prefetch; /* is prefetch enabled? */\n> >>\n> > ...\n> > Updating my patch — please let me know if there's anything else I can\n> > improve here.\n>\n> Renaming the .prefetch member to .prefetch_enabled would eliminate\n> the need to add any comment on the member in the header file.\n\nDo you mean for the struct member here or also the config? For the\nconfig, it'll probably be clearer\nto keep `prefetch` still as it aligns nicely with the boolean\n`--prefetch` command line flag.\n\nI can name the struct member `prefetch_enabled` — though I don't see\nother boolean remote properties (`prune`, `prune_tags`) add suffixes\nto indicate\nthey are booleans.\n\n> Thanks.\n"},{"id":"502273","messageId":"xmqq1q1y2dgm.fsf@gitster.g","threadId":"62057","inReplyTo":"CAG=Um+0P8SgWo2sN3St8+PpBneQfDBoqnpnC6uMmYu2YOOaWmQ@mail.gmail.com","subject":"Re: [PATCH v2] remote: prefetch config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-09-05T17:54:33Z","receivedAt":"2024-09-05T17:54:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shubham Kanodia <shubham.kanodia10@gmail.com> writes:\n\n> On Thu, Sep 5, 2024 at 10:22 PM Junio C Hamano <gitster@pobox.com> wrote:\n>>\n>> Shubham Kanodia <shubham.kanodia10@gmail.com> writes:\n>>\n>> >>\n>> >>         int prefetch; /* is prefetch enabled? */\n>> >>\n>> > ...\n>> > Updating my patch — please let me know if there's anything else I can\n>> > improve here.\n>>\n>> Renaming the .prefetch member to .prefetch_enabled would eliminate\n>> the need to add any comment on the member in the header file.\n>\n> Do you mean for the struct member here or also the config?\n\nI do not think I mentioned anything about the name of the\nconfiguration variable, but if I did that was a mistake.\n\nEnd-user facing configuration variables are often named after a\nfeature that it enables or disables, so it can use the name without\n\"enable\".  An int variable on the other hand can mean many other\nthings, ranging from \"how many times have we prefetched from here\"\nto \"does this remote allow prefetching?\", so a more explicit name\nwould often help.\n\nThanks.\n\n"},{"id":"502279","messageId":"pull.1779.v4.git.1725565398681.gitgitgadget@gmail.com","threadId":"62057","inReplyTo":"pull.1779.v3.git.1725554758463.gitgitgadget@gmail.com","subject":"[PATCH v4] remote: prefetch config","fromName":"Shubham Kanodia via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-09-05T19:43:18Z","receivedAt":"2024-09-05T19:43:23Z","isPatch":true,"sender":{"key":"shubham.kanodia10@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8946207?v=4"},"body":"From: Shubham Kanodia <shubham.kanodia10@gmail.com>\n\nLarge repositories often contain numerous branches and refs, many of\nwhich individual users may not need. This commit introduces a new\nconfiguration option (`remote.<remote>.prefetch`) to allow\nusers to specify which remotes to prefetch during\nthe maintenance task.\n\nKey behaviors:\n1. If `remote.<remote>.prefetch` is unset or true, running\n   `git-maintenance` will prefetch all refs for the remote.\n2. If `remote.<remote>.prefetch` is set to false, the remote\n   will be ignored for prefetching.\n\nIn a future change, we could also allow restricting the refs that are\nprefetched per remote using the `prefetchref` config option per remote.\n\nBoth of these options in unison would allow users to optimize their\nprefetch operations, reducing network traffic and disk usage.\n\nSigned-off-by: Shubham Kanodia <shubham.kanodia10@gmail.com>\n---\n    remote: prefetch config\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1779%2Fpastelsky%2Fsk%2Fmaintenance-prefetch-remote-v4\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1779/pastelsky/sk/maintenance-prefetch-remote-v4\nPull-Request: https://github.com/gitgitgadget/git/pull/1779\n\nRange-diff vs v3:\n\n 1:  c348f8efd33 ! 1:  80af121f835 remote: prefetch config\n     @@ builtin/gc.c: static int fetch_remote(struct remote *remote, void *cbdata)\n       \tif (remote->skip_default_update)\n       \t\treturn 0;\n       \n     -+\tif (!remote->prefetch)\n     ++\tif (!remote->prefetch_enabled)\n      +\t\treturn 0;\n      +\n       \tchild.git_cmd = 1;\n     @@ remote.c: static struct remote *make_remote(struct remote_state *remote_state,\n       \tCALLOC_ARRAY(ret, 1);\n       \tret->prune = -1;  /* unspecified */\n       \tret->prune_tags = -1;  /* unspecified */\n     -+\tret->prefetch = 1;\n     ++\tret->prefetch_enabled = 1;\n       \tret->name = xstrndup(name, len);\n       \trefspec_init(&ret->push, REFSPEC_PUSH);\n       \trefspec_init(&ret->fetch, REFSPEC_FETCH);\n     @@ remote.c: static int handle_config(const char *key, const char *value,\n       \telse if (!strcmp(subkey, \"prunetags\"))\n       \t\tremote->prune_tags = git_config_bool(key, value);\n      +\telse if (!strcmp(subkey, \"prefetch\"))\n     -+\t\tremote->prefetch = git_config_bool(key, value);\n     ++\t\tremote->prefetch_enabled = git_config_bool(key, value);\n       \telse if (!strcmp(subkey, \"url\")) {\n       \t\tif (!value)\n       \t\t\treturn config_error_nonbool(key);\n     @@ remote.h: struct remote {\n       \n       \tstruct refspec fetch;\n       \n     -+\tint prefetch;\n     ++\tint prefetch_enabled;\n      +\n       \t/*\n       \t * The setting for whether to fetch tags (as a separate rule from the\n\n\n Documentation/config/remote.txt   |  5 ++++\n Documentation/git-maintenance.txt |  7 +++---\n builtin/gc.c                      |  3 +++\n remote.c                          |  3 +++\n remote.h                          |  2 ++\n t/t7900-maintenance.sh            | 42 +++++++++++++++++++++++++++++++\n 6 files changed, 59 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/config/remote.txt b/Documentation/config/remote.txt\nindex 8efc53e836d..c2b3876192c 100644\n--- a/Documentation/config/remote.txt\n+++ b/Documentation/config/remote.txt\n@@ -33,6 +33,11 @@ remote.<name>.fetch::\n \tThe default set of \"refspec\" for linkgit:git-fetch[1]. See\n \tlinkgit:git-fetch[1].\n \n+remote.<name>.prefetch::\n+\tIf false, refs from the remote would not be prefetched for\n+\tthe prefetch task in linkgit:git-maintenance[1]. If not set,\n+\tthe value is assumed to be true.\n+\n remote.<name>.push::\n \tThe default set of \"refspec\" for linkgit:git-push[1]. See\n \tlinkgit:git-push[1].\ndiff --git a/Documentation/git-maintenance.txt b/Documentation/git-maintenance.txt\nindex 51d0f7e94b6..2fd38706ea2 100644\n--- a/Documentation/git-maintenance.txt\n+++ b/Documentation/git-maintenance.txt\n@@ -97,9 +97,10 @@ commit-graph::\n \n prefetch::\n \tThe `prefetch` task updates the object directory with the latest\n-\tobjects from all registered remotes. For each remote, a `git fetch`\n-\tcommand is run. The configured refspec is modified to place all\n-\trequested refs within `refs/prefetch/`. Also, tags are not updated.\n+\tobjects from all registered remotes unless they've disabled prefetch\n+\tusing `remote.<remote>.prefetch` set to `false`. For each such remote,\n+\ta `git fetch` command is run. The configured refspec is modified to place\n+\tall requested refs within `refs/prefetch/`. Also, tags are not updated.\n +\n This is done to avoid disrupting the remote-tracking branches. The end users\n expect these refs to stay unmoved unless they initiate a fetch.  However,\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex 427faf1cfe1..8da78290929 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -1027,6 +1027,9 @@ static int fetch_remote(struct remote *remote, void *cbdata)\n \tif (remote->skip_default_update)\n \t\treturn 0;\n \n+\tif (!remote->prefetch_enabled)\n+\t\treturn 0;\n+\n \tchild.git_cmd = 1;\n \tstrvec_pushl(&child.args, \"fetch\", remote->name,\n \t\t     \"--prefetch\", \"--prune\", \"--no-tags\",\ndiff --git a/remote.c b/remote.c\nindex 8f3dee13186..fc6eee21408 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -140,6 +140,7 @@ static struct remote *make_remote(struct remote_state *remote_state,\n \tCALLOC_ARRAY(ret, 1);\n \tret->prune = -1;  /* unspecified */\n \tret->prune_tags = -1;  /* unspecified */\n+\tret->prefetch_enabled = 1;\n \tret->name = xstrndup(name, len);\n \trefspec_init(&ret->push, REFSPEC_PUSH);\n \trefspec_init(&ret->fetch, REFSPEC_FETCH);\n@@ -456,6 +457,8 @@ static int handle_config(const char *key, const char *value,\n \t\tremote->prune = git_config_bool(key, value);\n \telse if (!strcmp(subkey, \"prunetags\"))\n \t\tremote->prune_tags = git_config_bool(key, value);\n+\telse if (!strcmp(subkey, \"prefetch\"))\n+\t\tremote->prefetch_enabled = git_config_bool(key, value);\n \telse if (!strcmp(subkey, \"url\")) {\n \t\tif (!value)\n \t\t\treturn config_error_nonbool(key);\ndiff --git a/remote.h b/remote.h\nindex b901b56746d..c448e5e6f9d 100644\n--- a/remote.h\n+++ b/remote.h\n@@ -77,6 +77,8 @@ struct remote {\n \n \tstruct refspec fetch;\n \n+\tint prefetch_enabled;\n+\n \t/*\n \t * The setting for whether to fetch tags (as a separate rule from the\n \t * configured refspecs);\ndiff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh\nindex abae7a97546..7484e1f1d46 100755\n--- a/t/t7900-maintenance.sh\n+++ b/t/t7900-maintenance.sh\n@@ -245,6 +245,48 @@ test_expect_success 'prefetch multiple remotes' '\n \ttest_subcommand git fetch remote2 $fetchargs <skip-remote1.txt\n '\n \n+test_expect_success 'prefetch respects remote.*.prefetch config' '\n+\ttest_create_repo prefetch-test-config &&\n+\t(\n+\t\tcd prefetch-test-config &&\n+\t\ttest_commit initial &&\n+\t\ttest_create_repo clone1 &&\n+\t\ttest_create_repo clone2 &&\n+\t\ttest_create_repo clone3 &&\n+\n+\t\tgit remote add remote1 \"file://$(pwd)/clone1\" &&\n+\t\tgit remote add remote2 \"file://$(pwd)/clone2\" &&\n+\t\tgit remote add remote3 \"file://$(pwd)/clone3\" &&\n+\n+\t\tgit config remote.remote1.prefetch false &&\n+\t\tgit config remote.remote2.prefetch true &&\n+\t\t# remote3 is left unset\n+\n+\t\t# Make changes in all clones\n+\t\tgit -C clone1 switch -c one &&\n+\t\tgit -C clone2 switch -c two &&\n+\t\tgit -C clone3 switch -c three &&\n+\t\ttest_commit -C clone1 one &&\n+\t\ttest_commit -C clone2 two &&\n+\t\ttest_commit -C clone3 three &&\n+\n+\t\t# Run maintenance prefetch task\n+\t\tGIT_TRACE2_EVENT=\"$(pwd)/prefetch.txt\" git maintenance run --task=prefetch 2>/dev/null &&\n+\n+\t\t# Check that if remotes were prefetched properly\n+\t\tfetchargs=\"--prefetch --prune --no-tags --no-write-fetch-head --recurse-submodules=no --quiet\" &&\n+\t\ttest_subcommand ! git fetch remote1 $fetchargs <prefetch.txt &&\n+\t\ttest_subcommand git fetch remote2 $fetchargs <prefetch.txt &&\n+\t\ttest_subcommand git fetch remote3 $fetchargs <prefetch.txt &&\n+\n+\t\t# Verify that changes are in the prefetch refs for remote2 and remote3, but not remote1\n+\t\ttest_must_fail git rev-parse refs/prefetch/remotes/remote1/one &&\n+\t\tgit fetch --all &&\n+\t\ttest_cmp_rev refs/remotes/remote2/two refs/prefetch/remotes/remote2/two &&\n+\t\ttest_cmp_rev refs/remotes/remote3/three refs/prefetch/remotes/remote3/three\n+\t)\n+'\n+\n test_expect_success 'loose-objects task' '\n \t# Repack everything so we know the state of the object dir\n \tgit repack -adk &&\n\nbase-commit: 2e7b89e038c0c888acf61f1b4ee5a43d4dd5e94c\n-- \ngitgitgadget\n"},{"id":"502284","messageId":"xmqqwmjpzull.fsf@gitster.g","threadId":"62057","inReplyTo":"pull.1779.v4.git.1725565398681.gitgitgadget@gmail.com","subject":"Re: [PATCH v4] remote: prefetch config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-09-05T20:57:58Z","receivedAt":"2024-09-05T20:58:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Shubham Kanodia via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Shubham Kanodia <shubham.kanodia10@gmail.com>\n> ...\n> In a future change, we could also allow restricting the refs that are\n> prefetched per remote using the `prefetchref` config option per remote.\n>\n> Both of these options in unison would allow users to optimize their\n> prefetch operations, reducing network traffic and disk usage.\n>\n> Signed-off-by: Shubham Kanodia <shubham.kanodia10@gmail.com>\n> ---\n\nLooking good.  Thanks.\n"},{"id":"502316","messageId":"CAG=Um+2EjRGJ_XTqHDuP3y+3BRK6SV_Wt9LNvjaBHGzrkVJibQ@mail.gmail.com","threadId":"62057","inReplyTo":"xmqqwmjpzull.fsf@gitster.g","subject":"Re: [PATCH v4] remote: prefetch config","fromName":"Shubham Kanodia","fromEmail":"shubham.kanodia10@gmail.com","sentAt":"2024-09-06T09:42:08Z","receivedAt":"2024-09-06T09:42:45Z","isPatch":true,"sender":{"key":"shubham.kanodia10@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8946207?v=4"},"body":"On Fri, Sep 6, 2024 at 2:28 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> \"Shubham Kanodia via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n> > From: Shubham Kanodia <shubham.kanodia10@gmail.com>\n> > ...\n> > In a future change, we could also allow restricting the refs that are\n> > prefetched per remote using the `prefetchref` config option per remote.\n> >\n> > Both of these options in unison would allow users to optimize their\n> > prefetch operations, reducing network traffic and disk usage.\n> >\n> > Signed-off-by: Shubham Kanodia <shubham.kanodia10@gmail.com>\n> > ---\n>\n> Looking good.  Thanks.\n\nHow long do you reckon changes like this typically remain in \"seen\"\nuntil merged upstream?\nI'm preparing part-2 of this change separately — so would be good to\nknow when I can submit that.\n"}]}