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

Re: git bundle vs git rev-list

From
Jeff King <peff@peff.net>
Date
Dec 6, 2014, 05:16 UTC
Message-ID
<20141206051651.GC31301@peff.net>
In-Reply-To
<CAL3By--xYnXFUdDP3MDxAxvfeBT3ArFrdAV=apzdWg6_kiD2Yg@mail.gmail.com>
On Fri, Dec 05, 2014 at 03:36:18PM -0700, Jesse Hopkins wrote:
> #Create the bundle
> git bundle create out.bundle --all "--since=<last_bundle_date>"

Others pointed out that a bug in the handling of --since may be the culprit here. However, I'd encourage you to use actual sha1s, as they are going to be more robust (especially in the face of any clock skew in the commit timestamps).

You should be able to follow a procedure like:
  1. On day 1, create a bundle from scratch:
       git bundle create out.bundle --all
  2. Before you send it out, record its tips in the local repository
     for later reference:
       git fetch out.bundle +refs/*:refs/remotes/bundle/*
  3. On day 2, create a bundle from the previously recorded tips:
       git bundle create out.bundle --all --not --remotes=bundle
  4. Update your tips in the same way:
       git fetch out.bundle +refs/*:refs/remotes/bundle/*
and so on for day 3 and onward.

Note that this is not the only way to store those tips (I just did it using git refs because it's simple to manipulate). You could also just store it in a file:

      # checkpoint
      git ls-remote out.bundle | cut -f1 | sort -u >tips
      # make incremental bundle
      git bundle create out.bundle --all --not $(cat tips)

This also makes it easy to recover if the other side ever gets out of sync (say you create and checkpoint a bundle on the sending side, but it never makes it to the remote; how do you know where to start from?). You can always get the latest set of tips from the remote by running:

      git ls-remote . | cut -f1 | sort -u >tips
on it and then sneaker-netting the tips file back to the sender.
-Peff
Previous: brian m. carlson
Message 6 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.