Re: [PATCH v3 2/3] shallow: offer to prune only non-existing entries
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Oct 26, 2018, 20:49 UTC
- Message-ID
- <20181026204914.134946-1-jonathantanmy@google.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.1810260956230.4546@tvgsbejvaqbjf.bet>
Show 8 quoted lines
> Thanks for confirming. > > So even better would be to use `is_promisor_object(oid) || > has_object_file(oid)`, right? > > This is something that is probably not even needed: as I mentioned, the > shallow commits are *expected* to be local. It should not ever happen that > they are fetched.
That would help, but I don't think it would help in the "fast-forward from A to B where A is B's parent" case I describe in [1].
My suggestion was:
> It sounds safer to me to use the fast approach in this patch when the > repository is not partial, and stick to the slow approach when it is.
which can be done by replacing "prune_shallow(0, 1)" in patch 3 with "prune_shallow(0, !repository_format_partial_clone)", possibly with a comment that the fast method checks object existence for each shallow line directly, which is undesirable when the repository is a partial clone. (repository_format_partial_clone is non-NULL with the name of the promisor remote if the repository is a partial clone, and NULL otherwise).
[1] https://public-inbox.org/git/20181025185459.206127-1-jonathantanmy@google.com/