Re: [PATCH 11/11] bundle: unbundle promisor packs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 7, 2022, 16:56 UTC
- Message-ID
- <xmqqv8wpu2fq.fsf@gitster.g>
- In-Reply-To
- <ee6c7a5b-63e8-af1c-fdb7-75dca9cd798d@github.com>
Derrick Stolee <derrickstolee@github.com> writes:
> Of course, looking closer at it... "git bundle unbundle" doesn't > actually store the refs directly in the refspace, but instead only > outputs the refs that it used.
True. I was more thinking about equivalence between
cd src_repo
git clone --no-local --filter=... . ../partial.network.cloned
git bundle create --filter=... partial.bndl
git clone partial.bndl ../partial.bundle.clonedThe two resulting repositories should look very similar except for that the remote.origin.* of the former would expect that it pushes back to where it was cloned from, while the latter would not.
Show 8 quoted lines
> + git init unbundled && > + ( > + cd unbundled && > + # This creates the first pack-file in the > + # .git/objects/pack directory. Look for a .promisor. > + git bundle unbundle ../partial.bdl >ref-list.txt && > + ls .git/objects/pack/pack-*.promisor >promisor && > + test_line_count = 1 promisor
And can we enumerate the objects we have in .git/objects, both loose and packed?
Show 7 quoted lines
> + ) && > + > + git clone --filter=blob:none --mirror "file://$(pwd)" cloned && > + git -C cloned for-each-ref \ > + --format="%(objectname) %(refname)" >cloned-refs.txt && > + echo "$(git -C cloned rev-parse HEAD) HEAD" >>cloned-refs.txt && > + test_cmp cloned-refs.txt unbundled/ref-list.txt
Likewise here? I think the two should match, and that was what I was wondering if we should enforce.
Show 9 quoted lines
> ' > done > > --- >8 --- > > I also attempted doing a "git clone --bare partial.bdl unbundled.git" to > get the 'git clone' command to actually place the refs. However, 'git clone' > does not set up the repository filter based on the bundle, so it reports > missing blobs (even though there is no checkout).
Understandable, as cloning from a bundle, if I recall correctly, was done as yet another special case in "git clone", differently from the main "over the network" code path. And from end-user's point of view, I think updating it is part of introducing the filtered bundle.
Thanks.