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

Re: [PATCH] fetch-pack: approximate no_dependents with filter

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2018, 22:09 UTC
Message-ID
<xmqqh8idns9i.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180924154516.48704-1-jonathantanmy@google.com>
Jonathan Tan <jonathantanmy@google.com> writes:
Show 19 quoted lines
> Whenever a lazy fetch is performed for a tree object, any trees and
> blobs it directly or indirectly references will be fetched as well.
> There is a "no_dependents" argument in struct fetch_pack_args that
> indicates that objects that the wanted object references need not be
> sent, but it currently has no effect other than to inhibit usage of
> object flags.
>
> Extend the "no_dependents" argument to also exclude sending of objects
> as much as the current protocol allows: when fetching a tree, all trees
> it references will be sent (but not the blobs), and when fetching a
> blob, it will still be sent. (If this mechanism is used to fetch a
> commit or any other non-blob object, all referenced objects, except
> blobs, will be sent.) The client neither needs to know or specify the
> type of each object it wants.
>
> The necessary code change is done in fetch_pack() instead of somewhere
> closer to where the "filter" instruction is written to the wire so that
> only one part of the code needs to be changed in order for users of all
> protocol versions to benefit from this optimization.

It is very clear how you are churning the code, but it is utterly unclear from the description what you perceived as a problem and why this change is a good (if not the best) solution for that problem, at least to me.

After reading the above description, I cannot shake the feeling that this is tied too strongly to the tree:0 use case? Does it help other use cases (e.g. would it be useful or harmful if a lazy clone was done to exclude blobs that are larger than certain threshold, or objects of all types that are not referenced by commits younger than certain threshold)?

Previous: Jonathan TanNext: Jonathan Tan
Message 2 of 7 in “fetch-pack: approximate no_dependents with filter”
  1. fetch-pack: approximate no_dependents with filterJonathan Tan, Sep 24, 2018
  2. Junio C HamanoSep 25, 2018
  3. Jonathan TanSep 27, 2018
  4. Junio C HamanoSep 29, 2018
  5. 0/2 Lazy fetch bug fix (and feature that reveals it)Jonathan Tan, Oct 3, 2018
  6. 1/2 fetch-pack: avoid object flags if no_dependentsJonathan Tan, Oct 3, 2018
  7. 2/2 fetch-pack: exclude blobs when lazy-fetching treesJonathan Tan, Oct 3, 2018

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.