Re: [Design RFC] Being more defensive about fetching commits in partial clone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 23, 2022 at 04:42:05PM -0800, Jonathan Tan wrote:

> A question remains of whether we would need to undo all this work if we decide
> to support commit filters in partial clones. Firstly, there are good arguments
> against (and, of course, for) commit filters in partial clones, so commit
> filters may not work out in the end anyway. Secondly, even if we do have commit
> filters, we at $DAYJOB think that we still need to differentiate, in some way,
> a fetch that we have accounted for in our design and a fetch that we haven't;
> commit chains have much greater lengths than tree chains and users wouldn't
> want to wait for Git to fetch commit by commit (or segment by segment, if we
> end up batch fetching commits as we probably will). So we would be building on
> the defensiveness of fetching commits in this case, not tearing it down.
> 
> My next step will be to send a patch modifying repo_parse_commit() to not
> lazy-fetch, and I think that future work will lie in identifying when we know
> that we are reading a commit and inhibiting lazy-fetches in those cases. If
> anyone has an opinion on this, feel free to let us know (hence the "RFC" in
> the subject).

In general, I think partial clones tend to know which filters were used
to create them, because we save that filter in the config. Would it be
reasonable before lazy-fetching to say "I am looking for an object of
type X; would my configured filters have skipped such an object?".

Then not only would you get the behavior you want for commits (which are
never skipped), but a blob:none clone would not try to lazy-fetch trees
(but a tree:depth one would lazy-fetch both trees and blobs).

The gotcha I'd worry about is that the config doesn't necessarily match
how the repository was originally created. There is nothing right now
saying you cannot partial-clone with one filter, then change the config
going forward.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux