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

Re: [PATCH v6] clone: add clone.<url>.defaultObjectFilter config

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 15, 2026, 21:32 UTC
Message-ID
<xmqqldfsrd7c.fsf@gitster.g>
In-Reply-To
<pull.2058.v6.git.1773553022381.gitgitgadget@gmail.com>
"Alan Braithwaite via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 37 quoted lines
> From: Alan Braithwaite <alan@braithwaite.dev>
>
> Add a new configuration option that lets users specify a default
> partial clone filter, optionally scoped by URL pattern.  When
> cloning a repository whose URL matches a configured pattern,
> git-clone automatically applies the filter, equivalent to passing
> --filter on the command line.
>
>     [clone]
>         defaultObjectFilter = blob:limit=1m
>
>     [clone "https://github.com/"]
>         defaultObjectFilter = blob:limit=5m
>
>     [clone "https://internal.corp.com/large-project/"]
>         defaultObjectFilter = blob:none
>
> The bare clone.defaultObjectFilter applies to all clones.  The
> URL-qualified form clone.<url>.defaultObjectFilter restricts the
> setting to matching URLs.  URL matching uses the existing
> urlmatch_config_entry() infrastructure, following the same rules as
> http.<url>.* — a domain, namespace, or specific project can be
> matched, and the most specific match wins.
>
> The config only affects the initial clone.  Once the clone completes,
> the filter is recorded in remote.<name>.partialCloneFilter, so
> subsequent fetches inherit it automatically.  An explicit --filter
> on the command line takes precedence, and --no-filter defeats the
> configured default entirely.
>
> Signed-off-by: Alan Braithwaite <alan@braithwaite.dev>
> ---
>     fetch, clone: add fetch.blobSizeLimit config
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2058%2Fabraithwaite%2Falan%2Ffetch-blob-size-limit-v6
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2058/abraithwaite/alan/fetch-blob-size-limit-v6
> Pull-Request: https://github.com/gitgitgadget/git/pull/2058

I as a bistander reviewer would have appreciated some mention of where some changes relative to the previous iteration came from.

E.g., check for !normalized_url case is from a realization that url_normaize() can return NULL. Use of test_when_finished all of the place is to clean cruft after each test did its thing.

What I am most unsure about is what the removal of "large.bin" in a test is about. What was it trying to achieve by having the file that weighs 100kB, and what was the reason the file got removed (is it because whatever the presence of the file was trying to verify in the previous iteration is already checked by other means and if so what is it? Or is it something else?).

Mechanically generated range-diff alone does not answer questions like the above.

Other than the "dd" thing, everything is looking good.
Will replace.  Thanks.
Previous: Alan Braithwaite via GitGitGadgetNext: Patrick Steinhardt
Message 27 of 30 in “fetch, clone: add fetch.blobSizeLimit config”
  1. fetch, clone: add fetch.blobSizeLimit configAlan Braithwaite via GitGitGadget, Mar 1, 2026
  2. Patrick SteinhardtMar 2, 2026
  3. Jeff KingMar 2, 2026
  4. Junio C HamanoMar 2, 2026
  5. Alan BraithwaiteMar 2, 2026
  6. Patrick SteinhardtMar 3, 2026
  7. Alan BraithwaiteMar 3, 2026
  8. Patrick SteinhardtMar 3, 2026
  9. Junio C HamanoMar 3, 2026
  10. Patrick SteinhardtMar 4, 2026
  11. Junio C HamanoMar 3, 2026
  12. Jeff KingMar 3, 2026
  13. clone: add clone.<url>.defaultObjectFilter configAlan Braithwaite via GitGitGadget, Mar 5, 2026
  14. Junio C HamanoMar 5, 2026
  15. Alan BraithwaiteMar 5, 2026
  16. clone: add clone.<url>.defaultObjectFilter configAlan Braithwaite via GitGitGadget, Mar 6, 2026
  17. brian m. carlsonMar 6, 2026
  18. Junio C HamanoMar 6, 2026
  19. Alan BraithwaiteMar 6, 2026
  20. clone: add clone.<url>.defaultObjectFilter configAlan Braithwaite via GitGitGadget, Mar 6, 2026
  21. Junio C HamanoMar 6, 2026
  22. Alan BraithwaiteMar 7, 2026
  23. clone: add clone.<url>.defaultObjectFilter configAlan Braithwaite via GitGitGadget, Mar 7, 2026
  24. Patrick SteinhardtMar 11, 2026
  25. Alan BraithwaiteMar 15, 2026
  26. clone: add clone.<url>.defaultObjectFilter configAlan Braithwaite via GitGitGadget, Mar 15, 2026
  27. Junio C HamanoMar 15, 2026
  28. Patrick SteinhardtMar 16, 2026
  29. Junio C HamanoMay 11, 2026
  30. Patrick SteinhardtMay 11, 2026

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.