From: Jeff King <peff@peff.net>
To: Nicolas Pitre <nico@fluxnic.net>
Cc: Zenaan Harkness <zen@freedbms.net>, git@vger.kernel.org
Subject: Re: Resumable clone/Gittorrent (again) - stable packs?
Date: Fri, 7 Jan 2011 00:22:07 -0500 [thread overview]
Message-ID: <20110107052207.GA23128@sigill.intra.peff.net> (raw)
In-Reply-To: <alpine.LFD.2.00.1101062221480.22191@xanadu.home>
On Thu, Jan 06, 2011 at 11:33:51PM -0500, Nicolas Pitre wrote:
> Here's what I suggest:
>
> cd my_project
> BUNDLENAME=my_project_$(date "+%s").gitbundle
> git bundle create $BUNDLENAME --all
> maketorrent-console your_favorite_tracker $BUNDLENAME
>
> Then start seeding that bundle, and upload $BUNDLENAME.torrent as
> bundle.torrent inside my_project.git on your server.
>
> Now... Git clients could be improved to first check for the availability
> of the file "bundle.torrent" on the remote side, either directly in
> my_project.git, or through some Git protocol extension. Or even better,
> the torrent hash could be stored in a Git ref, such as
> refs/bittorrent/bundle and the client could use that to retrieve the
> bundle.torrent file through some other means.
I really like the simplicity of this idea. It could even be generalized
to handle more traditional mirrors, too. Just slice up the refs/mirrors
namespace to provide different methods of fetching some initial set of
objects. For example, upload-pack might advertise (in addition to the
usual refs):
refs/mirrors/bundle/torrent
refs/mirrors/bundle/http
refs/mirrors/fetch/git
refs/mirrors/fetch/http
and the client can decide its preferred way of getting data: a bundle by
http or by torrent, or connecting directly to some other git repository
by git protocol or http. It would fetch the appropriate ref, which would
contain a blob in some method-specific format. For torrent, it would be
a torrent file. For the others, probably a newline-delimited set of
URLs. You could also provide a torrent-magnet ref if you didn't even
want to distribute the torrent file.
And no matter what the method used, at the end you have some set of refs
and objects, and you can re-try your (now much smaller fetch). And there
are a few obvious optimizations:
1. When you get the initial set of refs from the master, remember
them. If the mirror actually satisfies everything you were going to
fetch, then you don't even have to reconnect for the final fetch.
2. You can optionally cache the mirror list, and go straight to a
mirror for future fetches instead of checking the master. This is
only a reasonable thing to do if the mirrors are kept up to date,
and provide good incremental access (i.e., only actual git-protocol
mirrors, not torrent or http file).
-Peff
next prev parent reply other threads:[~2011-01-07 5:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 2:29 Resumable clone/Gittorrent (again) - stable packs? Zenaan Harkness
2011-01-06 17:05 ` Shawn Pearce
2011-01-10 16:39 ` John Wyzer
2011-01-10 21:42 ` Sam Vilain
2011-01-11 0:03 ` Nguyen Thai Ngoc Duy
2011-01-11 0:57 ` J.H.
2011-01-11 1:56 ` Nguyen Thai Ngoc Duy
2011-01-06 21:09 ` Nicolas Pitre
2011-01-07 2:36 ` Zenaan Harkness
2011-01-07 4:33 ` Nicolas Pitre
2011-01-07 5:22 ` Jeff King [this message]
2011-01-07 5:31 ` Jeff King
2011-01-07 10:04 ` Zenaan Harkness
2011-01-07 18:52 ` Ilari Liusvaara
2011-01-07 19:17 ` Jeff King
2011-01-07 21:45 ` Ilari Liusvaara
2011-01-07 21:56 ` Jeff King
2011-01-07 22:21 ` Ilari Liusvaara
2011-01-07 22:27 ` Jeff King
2011-01-10 21:07 ` Sam Vilain
2011-01-10 11:48 ` Nguyen Thai Ngoc Duy
2011-01-10 13:50 ` Nicolas Pitre
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=20110107052207.GA23128@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=nico@fluxnic.net \
--cc=zen@freedbms.net \
/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).