git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Jesse HopkinsNext: brian m. carlson
Message 2 of 6 in “git bundle vs git rev-list”
  1. Jesse HopkinsDec 5, 2014
  2. Junio C HamanoDec 5, 2014
  3. brian m. carlsonDec 5, 2014
  4. Junio C HamanoDec 5, 2014
  5. brian m. carlsonDec 5, 2014
  6. Jeff KingDec 6, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.