From: Mark Levedahl <mdl123@verizon.net>
To: git@vger.kernel.org
Subject: Respun - Scripts to use bundles to move data between repos
Date: Thu, 15 Feb 2007 19:19:51 -0500 [thread overview]
Message-ID: <11715851974102-git-send-email-mdl123@verizon.net> (raw)
Respun patch for git-bundle / git-unbundle.
I am working a project using git where we have many repositories on
machines that can never be directly connected, but which need to have
the same objects and development history. Existing git protocols offer
limited support: we can either a) publish and apply patch files branch
by branch, or b) copy an entire repository from one machine to another
and then do local push or fetch. While both are workable, neither is a
completely satisfactory solution, so I wrote the attached scripts that
support a "bundle" transfer mechanism. A bundle is a tar archive having
two files: a list of references as given by git-show-ref and a pack file
of objects from git-pack-objects. git-bundle creates the bundle,
git-unbundle unpacks and applies at the receiving end. The means of
transporting the bundle file between the machines is arbitrary (sneaker
net, email, etc all can work).
This transfer protocol leaves it to the user to assure that the objects
in the bundle are sufficient: git-fetch and git-push determine what is
needed by comparison, but no such conversation is possible here. The
approach is to specificy a range of commits to include in the bundle:
e.g. git-bundle master~10..master to get the last 10 commits. Having
too many is fine: git at the receiving end happily ignores duplicates.
Having too few objects raises an error and references are updated only
if their full set of dependencies are found in the target repository.
---
Thanks to all for comments on my previous set of patches on this topic,
I have respun them, taking the following actions on the various
suggestions.
1) Reformat help and .txt to fit 80 column screen: Done.
2) Use tar for the bundle, not zip. Done.
3) Link into main makefile: Done (including rename of git* to git*.sh
4) Link into Documentation/cmd-list.perl: Done.
5) Source git-sh-setup: Done (including removal of --bare and git dir
checks).
6) Use git-index-pack rather than git-unpack-objects -Done.
7) Pipe ref list directly into git-pack-objects. - doesn't handle
rev-list-args such as --since=5.days.ago, piping through git-rev-list
first does so I left it that way.
8) Shallow option was broken - removed as non-essential and too hard to
fix. (can re-add properly later if someone really wants it).
9) Dont use git-fsck, instead tell receiver what commits are needed
directly. Done, but with regrets. git-rev-list --objects-edge needs
to be taught to work when given --max-age, git-bundle calculates the
required result using a shell pipeline for the moment. Will revisit
after re-educating git-rev-list. (git-bundle does use git-rev-list
when --max-age is not present).
10) Allow --output file, rather than --output=file. Rejected as this
required git-bundle to check arguments for git-rev-list rather than
letting git-rev-parse do that, or requires a specific ordering of
inputs. The first violates separation of functions (let git-rev-parse
handle errors on arguments it takes), or simply trades one annoyance
for another. No available solution is better than what is there now.
11) Don't use temporary files in git-bundle. Left as is. Shell scrambles
binary data, so cannot be used to split out a binary pack file. This
is the service tar provides, and tar will only build from existing
files, so temporary files are needed unless this whole thing is
re-written in C.
Mark Levedahl
next reply other threads:[~2007-02-16 0:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-16 0:19 Mark Levedahl [this message]
2007-02-16 0:19 ` [PATCH] Add git-bundle - pack objects and references for disconnected transfer Mark Levedahl
2007-02-16 0:19 ` [PATCH] Add git-unbundle - unpack " Mark Levedahl
2007-02-16 0:19 ` [PATCH] Include git-bundle and git-unbundle in Makefile Mark Levedahl
2007-02-16 0:19 ` [PATCH] Create documentation for git-bundle Mark Levedahl
2007-02-16 0:19 ` [PATCH] Create documentation for git-unbundle Mark Levedahl
2007-02-16 0:19 ` [PATCH] Link git-bundle and git-unbundle docs from git(7) Mark Levedahl
2007-02-16 2:24 ` [PATCH] Add git-unbundle - unpack objects and references for disconnected transfer Junio C Hamano
2007-02-16 2:40 ` Linus Torvalds
2007-02-16 6:38 ` Mark Levedahl
2007-02-16 6:48 ` Shawn O. Pearce
2007-02-16 7:31 ` Junio C Hamano
2007-02-16 7:45 ` Shawn O. Pearce
2007-02-16 6:22 ` Mark Levedahl
2007-02-16 7:24 ` Junio C Hamano
2007-02-16 2:11 ` [PATCH] Add git-bundle - pack " Junio C Hamano
2007-02-16 4:41 ` Shawn O. Pearce
2007-02-16 7:28 ` Junio C Hamano
2007-02-16 6:39 ` Mark Levedahl
2007-02-16 6:54 ` Shawn O. Pearce
2007-02-16 11:57 ` Simon 'corecode' Schubert
2007-02-16 4:37 ` Respun - Scripts to use bundles to move data between repos Shawn O. Pearce
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=11715851974102-git-send-email-mdl123@verizon.net \
--to=mdl123@verizon.net \
--cc=git@vger.kernel.org \
/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).