git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Respun - Scripts to use bundles to move data between repos
@ 2007-02-16  0:19 Mark Levedahl
  2007-02-16  0:19 ` [PATCH] Add git-bundle - pack objects and references for disconnected transfer Mark Levedahl
  2007-02-16  4:37 ` Respun - Scripts to use bundles to move data between repos Shawn O. Pearce
  0 siblings, 2 replies; 22+ messages in thread
From: Mark Levedahl @ 2007-02-16  0:19 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2007-02-16 11:57 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-16  0:19 Respun - Scripts to use bundles to move data between repos Mark Levedahl
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

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).