Subject: Re: git bundle vs git rev-list

From: Junio C Hamano <[email-masked]>
Date: Fri, 05 Dec 2014 15:01:46 -0800

Jesse Hopkins <[email-masked]> 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.