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

Re: [PATCH] remote: introduce config to set prefetch refs

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 14, 2024, 20:11 UTC
Message-ID
<xmqqo74qro6f.fsf@gitster.g>
In-Reply-To
<CAG=Um+2e7kSL8wGFJcJtFAJt8AxyNwpemJNnxDNfsrm1SVVw1Q@mail.gmail.com>
Shubham Kanodia <shubham.kanodia10@gmail.com> writes:
Show 6 quoted lines
> If we're trying to determine if a pattern
> (remote.<remote>.prefetchref) is a subset of another or not
> (remote.<remote>.fetch) (to not accidentally expand the scope beyond
> `fetch`),
> we'd need a function that does that pattern-to-pattern. Are you aware
> of any existing functions that do so?

There is no such computation for this application. Such a computation might become needed if you wanted to complain that the user gave .prefetchref pattern that would never match what .fetch patterns would allow to pass. But there is no such need.

You will first get the advertised refs from the remote.  

Existing logic filteres them down to what matches configured remote.$name.fetch variable. filter_prefetch_refspec() may further reduces the result by removing those whose .src side begins with "refs/tags/".

Now you only look at what survived the above existing filtering, and further narrow it down by picking only ones that match the prefetch condition. If the refspec that survived the filtering by the fetch refspec (and existing logic in filter_prefetch_refspec()) does not satisfy the prefetch condition, it won't be prefetched.

Since you are using .prefetch ONLY TO narrow the result down, by definition, you are not adding anything what .fetch configuration would not have fetched.

Previous: Shubham KanodiaNext: Shubham Kanodia
Message 9 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.