From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: git@vger.kernel.org,
Shubham Kanodia <shubham.kanodia10@gmail.com>,
Derrick Stolee <stolee@gmail.com>
Subject: Re*: What's cooking draft as of 2024-09-06 late night
Date: Sat, 07 Sep 2024 09:42:12 -0700 [thread overview]
Message-ID: <xmqq8qw3xvob.fsf_-_@gitster.g> (raw)
In-Reply-To: <899eb2c2-bb18-4666-98d8-9255dedfac53@gmail.com> (Phillip Wood's message of "Sat, 7 Sep 2024 10:17:32 +0100")
Phillip Wood <phillip.wood123@gmail.com> writes:
> Hi Junio and Shubham
>
> On 07/09/2024 06:41, Junio C Hamano wrote:
>> Will merge to 'next'?
>> - sk/enable-prefetch-per-remote 09-05 #1
>> <pull.1779.v4.git.1725565398681.gitgitgadget@gmail.com>
>
> I've just taken a look at this and I'm left wondering why one would
> want to skip prefetching from a remote but still fetch from it with
> "git fetch --all". I set remote.<remote>.skipFetchAll for the remotes
> I don't want to prefetch.
It is nice to see a review from somebody who fetches from multiple
remotes in real life. Very much appreciated. I have a few
repositories to pull from, but I never do "fetch --all", so
skipFetchAll was totally outside my awareness.
> We also have remote.<remote>.skipDefaultUpdate I don't know
> offhand if that prevents a remote from being prefetched as well.
Yuck. And this one is described with an identical text as the
previous one. What is going on?
... goes and looks ...
Ah, yes, they internally update the same .skip_default_update member
in the struct remote; the only bug is that the documentation does
not make it clear that they are synonyms to each other.
What is curious is that 7cc91a2f (Add the configuration option
skipFetchAll, 2009-11-09) added for the sole purpose of adding this
one, without explaining anything about the reason why it was needed,
and my quick browsing did not find any discussion on the topic in
the era.
In any case, a remote that has .skip_default_update member set
indeed is exempt from prefetch since 32f67888 (maintenance: respect
remote.*.skipFetchAll, 2021-04-16), so it is a viable alternative
(assuming that nobody would want to omit prefetching from a remote
even if they want to fetch from the remote with "fetch --all" or
"remote update", which is a sensible assumption) to just document
this existing behaviour to help the users.
> I think being able to specify which refs are prefectched would be
> useful.
Yes, that is what we said it is OK to punt in the first step, which
is fine to be done in the follow-up step.
--- >8 ---
Subject: doc: remote.*.skip{DefaultUpdate,FetchAll} stops prefetch
Back when 7cc91a2f (Add the configuration option skipFetchAll,
2009-11-09) added for the sole purpose of adding skipFetchAll as a
synonym to skipDefaultUpdate, there was no explanation about the
reason why it was needed., but these two configuration variables
mean exactly the same thing.
Also, when we taught the "prefetch" task to "git maintenance" later,
we did make it pay attention to the setting, but we forgot to
document it.
Document these variables as synonyms that collectively implements
the last-one-wins semantics, and also clarify that the prefetch task
is also controlled by this variable.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
* Note that "skipped by default" in the original has been rewritten
to "skipped" (unconditional), and this is deliberate. When there
is no conditionality and the behaviour is the only available one,
it is *not* "by default".
Documentation/config/remote.txt | 13 +++++++------
Documentation/git-maintenance.txt | 3 +++
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git c/Documentation/config/remote.txt w/Documentation/config/remote.txt
index 8efc53e836..36e771556c 100644
--- c/Documentation/config/remote.txt
+++ w/Documentation/config/remote.txt
@@ -42,14 +42,15 @@ remote.<name>.mirror::
as if the `--mirror` option was given on the command line.
remote.<name>.skipDefaultUpdate::
- If true, this remote will be skipped by default when updating
- using linkgit:git-fetch[1] or the `update` subcommand of
- linkgit:git-remote[1].
+ A deprecated synonym to `remote.<name>.skipFetchAll` (if
+ both are set in the configuration files with different
+ values, the value of the last occurrence will be used).
remote.<name>.skipFetchAll::
- If true, this remote will be skipped by default when updating
- using linkgit:git-fetch[1] or the `update` subcommand of
- linkgit:git-remote[1].
+ If true, this remote will be skipped when updating
+ using linkgit:git-fetch[1], the `update` subcommand of
+ linkgit:git-remote[1], and ignored by the prefetch task
+ of `git maitenance`.
remote.<name>.receivepack::
The default program to execute on the remote side when pushing. See
diff --git c/Documentation/git-maintenance.txt w/Documentation/git-maintenance.txt
index 51d0f7e94b..9d96819133 100644
--- c/Documentation/git-maintenance.txt
+++ w/Documentation/git-maintenance.txt
@@ -107,6 +107,9 @@ with the prefetch task, the objects necessary to complete a later real fetch
would already be obtained, making the real fetch faster. In the ideal case,
it will just become an update to a bunch of remote-tracking branches without
any object transfer.
++
+The `remote.<name>.skipFetchAll` configuration can be used to
+exclude a particular remote from getting prefetched.
gc::
Clean up unnecessary files and optimize the local repository. "GC"
next prev parent reply other threads:[~2024-09-07 16:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-07 5:41 What's cooking draft as of 2024-09-06 late night Junio C Hamano
2024-09-07 9:17 ` Phillip Wood
2024-09-07 16:42 ` Junio C Hamano [this message]
2024-09-07 19:33 ` Re*: " Shubham Kanodia
2024-09-09 9:13 ` Phillip Wood
2024-09-09 15:53 ` Junio C Hamano
2024-09-10 8:42 ` Phillip Wood
2024-09-10 14:41 ` Junio C Hamano
2024-09-09 9:13 ` Phillip Wood
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=xmqq8qw3xvob.fsf_-_@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=phillip.wood123@gmail.com \
--cc=shubham.kanodia10@gmail.com \
--cc=stolee@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).