From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: Shubham Kanodia <shubhamsizzles@gmail.com>, git@vger.kernel.org
Subject: Re: Improvement: `git-maintenance` to allow configuring of remotes to fetch
Date: Tue, 03 Sep 2024 09:07:42 -0700 [thread overview]
Message-ID: <xmqq5xrcn2k1.fsf@gitster.g> (raw)
In-Reply-To: <ZtacHCuql0pX3V2u@tanuki> (Patrick Steinhardt's message of "Tue, 3 Sep 2024 07:18:20 +0200")
Patrick Steinhardt <ps@pks.im> writes:
> The prefetch refspec would be rewritten by git-maintenance(1) such that
> the destination part (the right-hand side of the refspec) is prefixed
> with `refs/prefetch/`, same as the fetch refspec would be changed in
> this way.
>
> An alternative would be to _not_ rewrite the prefetch refspec at all and
> thus allow the user to prefetch into arbitrary hierarchies. But I'm a
> bit worried that this might cause users to misconfigure prefetches by
> accident, causing it to overwrite their usual set of refs.
I agree that it is the right place to configure this as attributes
to remotes. It would make it handy if we could give a catch-all
configuration, though. For example:
[remote "origin"]
prefetch = true
prefetchref = refs/heads/* refs/tags/*
[remote "*"]
prefetch = false
may toggle prefetch off for all remotes, except that the tags and
the local branches of the remote "origin" are prefetched. Instead
of a multi-value configuration variable (like remote.*.fetch) where
we need to worry about clearing convention, we can use a regular
"last one wins" variable that is whitespace separated patterns, as
such a pattern can never have a whitespace in it.
As you too agree with the position to consider "prefetch" should be
invisible to the end-users, we should not allow users to specify the
full refspec at all, or if it is forced or not with "+" prefix.
Only accept a set of patterns to match, and keep it opaque where in
the local refs/* hierarchy they are stored. It is an implementation
detail that the users should not have to know about and rely on.
Thanks.
next prev parent reply other threads:[~2024-09-03 16:07 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
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 [this message]
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=xmqq5xrcn2k1.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
--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).