Re: [PATCH] fetch: allow adding a filter after initial clone.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 13, 2020, 22:18 UTC
- Message-ID
- <xmqqsgg3qy1v.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CAOhzdui-4KeOit74fTy=3YxSncHGZzy+cE+6njyjHPyJ8xFpMA@mail.gmail.com>
Xin Li <delphij@google.com> writes:
Show 14 quoted lines
> The proposed change would allow converting an existing git clone to > use partial clones. For example: > > $ git clone --depth=1 https://android.googlesource.com/platform/bionic . > $ git fetch --unshallow --filter=blob:none origin > > Previously, to allow this one would have to do the following manually > first; the existing code would handle the rest gracefully: > > $ git config core.repositoryFormatVersion 1 > $ git config extensions.partialClone origin > > And the proposed change would have git do it for the user > automatically, the existing workflow remains otherwise unchanged.
Actually, do we even know, when we "upgrade" the repository with the patch, that the 'origin' supports the required protocol extensions like on-demand fetching of objects?
At "git clone" time, "git clone --filter=..." against a server that is not prepared to serve as a lazy clone's backup remote would fail, so we will never write extensions.partialClone=origin when origin cannot serve as such.
But writing these config you suggest to "do manually" is already not a safe thing to do, without making sure it is supported, no? It does not sound like a good idea to do an unsafe thing for the user automatically.
Added a few folks on Cc: list, who know and care more about partial clones than I do for input.
Thanks.