git bundle unbundle /tmp/foo --all
but this just lists all references...
Actually, it now can do more than that:
Git 2.34 (Q4 2021) adds progress display to "git bundle unbundle"(man)".
In addition to git bundle verify mentioned in this answer, it will show you at least what is going on.
See commit d941cc4, commit f46c46e, commit 7366096 (05 Sep 2021), and commit 0834257 (26 Aug 2021) by Ævar Arnfjörð Bjarmason (avar).
(Merged by Junio C Hamano -- gitster -- in commit 67fc02b, 20 Sep 2021)
bundle: show progress on "unbundle"
Signed-off-by: Ævar Arnfjörð Bjarmason
The "unbundle" command added in 2e0afaf ("Add git-bundle: move objects and references by archive", 2007-02-22, Git v1.5.1-rc1 -- merge) did not show progress output, even though the underlying API learned how to show progress in be042af ("Teach progress eye-candy to fetch_refs_from_bundle()", 2011-09-18, Git v1.7.8-rc0 -- merge).
Now we'll show "Unbundling objects" using the new --progress-title option togit index-pack"(man), to go with its existing "Receiving objects" and "Indexing objects" (which it shows when invoked with "--stdin", and with a pack file, respectively).
Unlike "git bundle create"(man) we don't handle "--quiet" here, nor "--all-progress" and "--all-progress-implied".
Those are all specific to "create" (and "verify", in the case of "--quiet").
The structure of the existing documentation is a bit unclear, e.g. the documentation for the "--quiet" option added in 79862b6 ("bundle-create: progress output control", 2019-11-10, Git v2.25.0-rc0 -- merge listed in batch #2) only describes how it works for "create", and not for "verify".
That and other issues in it should be fixed, but I'd like to avoid untangling that mess right now.
Let's just support the standard "--no-progress" implicitly here, and leave cleaning up the general behavior of "git bundle"(man) for a later change.
git bundle now includes in its man page:
'git bundle' unbundle [--progress] <file> [<refname>...]
"git bundle unbundle"(man) outside a repository triggered a BUG() unnecessarily: that has been corrected with Git 2.47 (Q4 2024), batch 7.
See commit 96a9a3e, commit 7298bcc (13 Aug 2024) by Patrick Steinhardt (pks-t).
(Merged by Junio C Hamano -- gitster -- in commit b772c9c, 21 Aug 2024)
builtin/bundle: have unbundle check for repo before opening its bundle
Reported-by: ArcticLampyrid
Suggested-by: Jeff King
Signed-off-by: Patrick Steinhardt
The git bundle unbundle(man) subcommand requires a repository to unbundle the contents into.
As thus, the subcommand checks whether we have a startup repository in the first place, and if not it dies.
This check happens after we have already opened the bundle though.
This causes a segfault when running outside of a repository starting with c8aed5e ("repository: stop setting SHA1 as the default object hash", 2024-05-07, Git v2.46.0-rc0 -- merge listed in batch #9) because we have no hash function set up, but we do try to parse refs advertised by the bundle's header.
And:
bundle: default to SHA1 when reading bundle headers
Helped-by: brian m. carlson
Signed-off-by: Patrick Steinhardt
We hit a segfault when trying to open a bundle via git bundle list-heads(man) when running outside of a repository.
This is caused by c8aed5e ("repository: stop setting SHA1 as the default object hash", 2024-05-07, Git v2.46.0-rc0 -- merge listed in batch #9), which stopped setting the default object hash so that the_hash_algo is a NULL pointer when running outside of any repo.
This is only a symptom of a deeper issue though.
Bundles default to the SHA1 object format unless they advertise an "@object-format=" header.
Consequently, it has been wrong in the first place to use the object format used by the current repository when parsing bundles.
The consequence is that trying to open a bundle that uses a different object hash than the current repository will fail:
$ git bundle list-heads sha1.bundle
error: unrecognized header: ee4b540943284700a32591ad09f7e15bdeb2a10c HEAD (45)
Fix the bug by defaulting to the SHA1 object hash.
We already handle the "@object-format=" header as expected, so we don't need to adapt this part.