Re: [PATCH v2 01/10] bundle: optionally skip reachability walk
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 23, 2023, 18:03 UTC
- Message-ID
- <xmqqsfg1m8l6.fsf@gitster.g>
- In-Reply-To
- <b3828725bc8f8887b9b4777a0e3d84224a427f31.1674487310.git.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 22 quoted lines
> From: Derrick Stolee <derrickstolee@github.com> > > When unbundling a bundle, the verify_bundle() method checks two things > with regards to the prerequisite commits: > > 1. Those commits are in the object store, and > 2. Those commits are reachable from refs. > > During testing of the bundle URI feature, where multiple bundles are > unbundled in the same process, the ref store did not appear to be > refreshing with the new refs/bundles/* references added within that > process. This caused the second half -- the reachability walk -- report > that some commits were not present, despite actually being present. > > One way to attempt to fix this would be to create a way to force-refresh > the ref state. That would correct this for these cases where the > refs/bundles/* references have been updated. However, this still is an > expensive operation in a repository with many references. > > Instead, optionally allow callers to skip this portion by instead just > checking for presence within the object store. Use this when unbundling > in bundle-uri.c.
This step is new in this round.
I am assuming that this approach is to avoid repeated "now we unbundled one, let's spend enormous cycles to update the in-core view of the ref store before processing the next bundle"---instead we unbundle all, assuming the prerequisites for each and every bundle are satisfied.
I am OK as long as we check the assumption holds true at the end; this looks like a good optimization.