git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4] remote: allow specifying refs to prefetch

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 6, 2024, 06:52 UTC
Message-ID
<ZysSEJUqSKUq4PKb@pks.im>
In-Reply-To
<xmqqy11xqjpx.fsf@gitster.g>
On Tue, Nov 05, 2024 at 04:39:06PM -0800, Junio C Hamano wrote:
Show 41 quoted lines
> Shubham Kanodia <shubham.kanodia10@gmail.com> writes:
> 
> > I don't have a particular preference here, and this was discussed in
> > an earlier thread
> > where Junio opined (https://lore.kernel.org/git/xmqq5xrcn2k1.fsf@gitster.g/—
> >
> >> 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.
> > which is what my implementation is based on.
> 
> I am fine with space separated list or multi-valued variable.  The
> only difference is that with multi-valued list, we'd need to worry
> about ensuring that we have a way to "clear" the values we have seen
> so far.  It has plenty of precedence and is not a rocket science.
> The above, if I recall correctly, was solely about the need for
> "catch-all default" (aka "*" remote) and not about multi-value vs
> space separated last-one-wins value at all.  IOW, the above could
> have been
> 
>     [remote "origin"]
> 	prefetch = true
> 	prefetchref = refs/heads/*
> 	prefetchref = refs/tags/*
>     [remote "*"]
> 	prefetch = false
> 
> and conveyed exactly what I wanted to say in the message you quoted.
Ah, I missed your mail here. I replied to this bit in a parallel email.
Show 5 quoted lines
> In any case, I somehow thought that we discarded the arrangement
> with "*" wildcard as unworkable.  If I remember the discussion
> before I left correctly, didn't it turn out to be troublesome to
> have [remote "*"] section because existing code would need to
> enumerate configured remotes, and we do not want to see "*" listed?

I wouldn't say unworkable, but it certainly isn't as easy as just adding the new syntax.

Show 5 quoted lines
> If we found a workable solution to that while I was away, that would
> be great, but I haven't looked at what this latest round of the
> series does to solve it (yet).  Perhaps teaching "git remote" and
> "git fetch --all" to skip "*" while enumerating remotes was
> sufficient?  I dunno.

So yes, we'd have to teach Git to ignore "*" remotes in many places. I would hope that it isn't all that involved and that we only need to adjust a couple of places to ignore "*". But the remote logic is somewhat outside of my area of expertise, so my hope might be misplaced.

If so, we might think about using a different syntax to achieve the same thing.

Patrick
Previous: Junio C HamanoNext: Junio C Hamano
Message 23 of 27 in “remote: introduce config to set prefetch refs”
  1. remote: introduce config to set prefetch refsShubham Kanodia via GitGitGadget, Sep 9, 2024
  2. Shubham KanodiaSep 9, 2024
  3. Junio C HamanoSep 9, 2024
  4. Shubham KanodiaSep 9, 2024
  5. Junio C HamanoSep 9, 2024
  6. Shubham KanodiaSep 13, 2024
  7. Junio C HamanoSep 13, 2024
  8. Shubham KanodiaSep 14, 2024
  9. Junio C HamanoSep 14, 2024
  10. Shubham KanodiaSep 15, 2024
  11. Junio C HamanoSep 15, 2024
  12. Shubham KanodiaSep 16, 2024
  13. remote: introduce config to set prefetch refsShubham Kanodia via GitGitGadget, Sep 15, 2024
  14. remote: introduce config to set prefetch refsShubham Kanodia via GitGitGadget, Sep 19, 2024
  15. Junio C HamanoSep 23, 2024
  16. Shubham KanodiaOct 7, 2024
  17. remote: allow specifying refs to prefetchShubham Kanodia via GitGitGadget, Oct 4, 2024
  18. Shubham KanodiaNov 4, 2024
  19. Patrick SteinhardtNov 5, 2024
  20. Phillip WoodNov 5, 2024
  21. Shubham KanodiaNov 5, 2024
  22. Junio C HamanoNov 6, 2024
  23. Patrick SteinhardtNov 6, 2024
  24. Junio C HamanoNov 6, 2024
  25. Patrick SteinhardtNov 6, 2024
  26. Phillip WoodNov 6, 2024
  27. Phillip WoodNov 5, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.