From: Patrick Steinhardt <ps@pks.im>
To: Shubham Kanodia <shubhamsizzles@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Improvement: `git-maintenance` to allow configuring of remotes to fetch
Date: Wed, 28 Aug 2024 13:32:34 +0200 [thread overview]
Message-ID: <Zs8KzG0vzCEDvkvx@tanuki> (raw)
In-Reply-To: <CAG=Um+1wTbXn_RN+LOCrpZpSNR_QF582PszxNyhz5anVHtBp+w@mail.gmail.com>
On Mon, Aug 26, 2024 at 05:20:50PM +0530, Shubham Kanodia wrote:
> `git-maintenance` aims to improve the health & performance of
> especially large git repositories.
> A part of git maintenance tasks is `prefetch`.
>
> However, at the moment, it prefetches all objects from all branches —
>
> > The prefetch task updates the object directory with the latest objects from all registered remotes.
>
> This seems non-optimal for repositories where users use the main
> repository to fork branches (instead of personal forks) as the remote
> could have thousands of refs and objects from branches that a user may
> not care about, leading to a very large prefetch dir.
>
> For large repositories, it might instead be helpful to only fetch
> objects on `main` or `master` because those are the ones most likely
> to be used by users.
>
> To this effect, git maintenance should perhaps expose a
> maintenance.prefetch.refs setting that subsets prefetching only to
> certain references.
I think that this makes sense as an addition. We would have to think
about things like globbing and whatnot, such that we can say e.g. to
prefetch only tags, only branches or only a subset thereof. We may even
decide to use refspecs here, which could be the most flexible way of
configuring this. We already use the default refspecs anyway -- the only
thing we change is that we prefix the refspec destination with
"refs/prefetch/". So allowing the user to override the refspec used for
prefetching makes sense.
It opens up another question though: if you've got multiple remotes in a
repository, do we also want to make it configurable which of these
should be fetched from? And if you do, do you want to allow configuring
refs to fetch per remote? I guess the answer to both of these questions
would be "yes".
> Is this something that has been raised before / is in works by any
> chance or something that would be an acceptable contribution?
I'm not aware of any discussion around this, and think that this feature
does make sense indeed.
Patrick
next prev parent reply other threads:[~2024-08-28 11:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 11:50 Improvement: `git-maintenance` to allow configuring of remotes to fetch Shubham Kanodia
2024-08-28 11:32 ` Patrick Steinhardt [this message]
2024-08-28 16:31 ` Junio C Hamano
2024-09-02 15:46 ` Shubham Kanodia
2024-09-03 5:18 ` Patrick Steinhardt
2024-09-03 6:01 ` Shubham Kanodia
2024-09-03 9:48 ` Patrick Steinhardt
2024-09-03 16:07 ` Junio C Hamano
2024-09-04 16:29 ` Shubham Kanodia
2024-09-04 18:10 ` 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=Zs8KzG0vzCEDvkvx@tanuki \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=shubhamsizzles@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).