git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jesse Hopkins <jesse.hops@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git bundle vs git rev-list
Date: Sat, 6 Dec 2014 00:16:51 -0500	[thread overview]
Message-ID: <20141206051651.GC31301@peff.net> (raw)
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

      parent reply	other threads:[~2014-12-06  5:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 22:36 git bundle vs git rev-list Jesse Hopkins
2014-12-05 23:01 ` Junio C Hamano
2014-12-05 23:13 ` brian m. carlson
2014-12-05 23:40   ` Junio C Hamano
2014-12-05 23:42     ` brian m. carlson
2014-12-06  5:16 ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141206051651.GC31301@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jesse.hops@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).