All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] fetch-pack: approximate no_dependents with filter
Date: Tue, 25 Sep 2018 15:09:45 -0700	[thread overview]
Message-ID: <xmqqh8idns9i.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180924154516.48704-1-jonathantanmy@google.com> (Jonathan Tan's message of "Mon, 24 Sep 2018 08:45:16 -0700")

Jonathan Tan <jonathantanmy@google.com> writes:

> 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)?


  reply	other threads:[~2018-09-25 22:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 15:45 [PATCH] fetch-pack: approximate no_dependents with filter Jonathan Tan
2018-09-25 22:09 ` Junio C Hamano [this message]
2018-09-27 18:37   ` Jonathan Tan
2018-09-29 20:26 ` Junio C Hamano
2018-10-03 23:04 ` [PATCH v2 0/2] Lazy fetch bug fix (and feature that reveals it) Jonathan Tan
2018-10-03 23:04   ` [PATCH v2 1/2] fetch-pack: avoid object flags if no_dependents Jonathan Tan
2018-10-03 23:04   ` [PATCH v2 2/2] fetch-pack: exclude blobs when lazy-fetching trees Jonathan Tan

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=xmqqh8idns9i.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.