Re: git bundle vs git rev-list
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 5, 2014, 23:01 UTC
- Message-ID
- <xmqqlhmlog4l.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAL3By--xYnXFUdDP3MDxAxvfeBT3ArFrdAV=apzdWg6_kiD2Yg@mail.gmail.com>
Jesse Hopkins <jesse.hops@gmail.com> writes:
> 2. Is there a way to list commits contained in the bundle file itself? > This seems like it would be more robust than trying to re-create the > commit list via 'git rev-list'.
"git bundle list-heads o.bndl" shows the positive endpoints, but there is no corresponding "git bundle list-prereq" that shows the prerequisite commits.
Running "git bundle verify o.bndl" in an empty directory will show the negative endpoints that are required to be in the receiving repository in its error message, e.g.
$ git bundle verify ~/w/git.git/o.bndle
error: Repository lacks these prerequisite commits:
error: bf404025edf1d7f5a69aa07cbaa88622e9d528df
error: 15ab2081fff5b234ec5705a8645d39c1fdcf204c
...so collecting them would be one way to substitute "list-prereq".
Once you learned the positive and negative endpoints, running "git rev-list --objects $positive_ones --not $negative_ones" should list all the objects contained in the bundle.