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

Re: full kernel history, in patchset format

From
Junio C Hamano <junkio@cox.net>
Date
Apr 16, 2005, 18:31 UTC
Message-ID
<7vmzry7ev5.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0504160953310.7211@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:

LT> What do people think? I'm not so much worried about the data itself: the LT> git architecture is _so_ damn simple that now that the size estimate has LT> been confirmed, that I don't think it would be a problem per se to put LT> 3.2GB into the archive. But it will bog down "rsync" horribly, so it will LT> actually hurt synchronization untill somebody writes the rev-tree-like LT> stuff to communicate changes more efficiently..

LT> IOW, it smells to me like we don't have the infrastructure to really work LT> with 3GB archives, and that if we start from scratch (2.6.12-rc2), we can LT> build up the infrastructure in parallell with starting to really need it.

LT> But it's _great_ to have the history in this format, especially since LT> looking at CVS just reminded me how much I hated it.

LT> Comments?

I have been cooking this idea before I dove into the merge stuff and did not have time to implement it myself (Hint Hint), but I think something along the following lines would work nicely:

 * A script git-archive-tar is used to create a "base tarball"
   that roughly corresponds to "linux-*.tar.gz".  This works as
   follows:
    $ git-archive-tar C [B1 B2...]
   This reads the named commit C, grabs the associated tree
   (i.e.  its sub-tree objects and the blob they refer to), and
   makes a tarball of ??/??????????????????????????????????????
   files.  The tarball does not have to contain any extra
   information to reproduce any ancestor of the named commit.
   When extra parameters, B1 B2..., are given, it also creates
   "diff package" that roughly corresponds to "patch-*.gz" for
   each Bn given.  They must be ancestors of commit.  The
   intention is to store enough information to ensure that the
   recipient can recreate all the SHA1 files "base tarball" for
   commits between (Bn, C] would contain, provided if the
   recipient already has all the SHA1 files "base tarball" for
   Bn.
 * A script git-archive-patch is used to read such a "diff
   package".
So a user needs to:
 * First pick some baseline B and download the base tarball for
   commit B.  It is up to him to make trade-offs between how far
   back he wants to see the history and how much bandwidth he
   wants to waste.  Untar it to get the baseline.
 * Then periodically pick up "diff package" for (C, B] where C
   is the latest available.  Run git-archive-patch to populate
   the rest.
 * In addition the user can run rsync with timestamp option to
   pick up SHA1 files created upstream since C after this
   happens.

What git-archive-tar needs to do to produce "diff package" for (Bn, C] is fairly obvious.

 * From rev-tree output, find all the commits that are on path
   from Bn to C.
 * Find all the SHA1 objects that appear on this commit chain;
   subtract what is in Bn since we assume the recipient has them
   already.
 * Run diff-tree between neighboring commits [*1*] to find out
   the set of blobs that are "related".  Extract those related
   blobs and run "diff" [*2*] between them to see if it produces
   a patch smaller than the whole thing when compressed.  If
   diff+patch is a win, then we do not have to transmit the blob
   that we could reproduce by sending the diff.  Note that fact.
 * When you are all done, you have a single patch file that
   contains small edits on numerous blobs, and set of SHA1 files
   that are cheaper to transmit than in the patch form.
   Compress the patch file and package them together to make a
   tar archive.

Given the above, the operation of git-archive-patch is also quite obvious. Extract the "diff package" tarball into the objects/ directory that has (at least) the full Bn, uncompress the patch file part, and run patch on it.

[Footnotes]

*1* Alternatively, this diff-tree can be run between Bn and each commit between (Bn, C]. It is like incremental dump strategy. We should experiment and find a good balance.

*2* This does not have to be "diff -u" --- we are assuming the exact patch so diff -e or xdelta would do. We should experiment and find a good diff+patch pair.

Previous: Christopher LiNext: Mike Taht
Message 9 of 42 in “full kernel history, in patchset format”
  1. Ingo MolnarApr 16, 2005
  2. Ingo MolnarApr 16, 2005
  3. David MansfieldApr 16, 2005
  4. Ingo MolnarApr 16, 2005
  5. Francois RomieuApr 16, 2005
  6. Linus TorvaldsApr 16, 2005
  7. Petr BaudisApr 16, 2005
  8. Christopher LiApr 16, 2005
  9. Junio C HamanoApr 16, 2005
  10. Mike TahtApr 16, 2005
  11. Junio C HamanoApr 16, 2005
  12. Christopher LiApr 16, 2005
  13. Junio C HamanoApr 16, 2005
  14. Mike TahtApr 16, 2005
  15. Daniel BarkalowApr 16, 2005
  16. Junio C HamanoApr 16, 2005
  17. Jan-Benedict GlawApr 16, 2005
  18. Thomas GleixnerApr 16, 2005
  19. Petr BaudisApr 16, 2005
  20. Petr BaudisApr 16, 2005
  21. Thomas GleixnerApr 16, 2005
  22. Linus TorvaldsApr 16, 2005
  23. Thomas GleixnerApr 16, 2005
  24. Petr BaudisApr 16, 2005
  25. Junio C HamanoApr 16, 2005
  26. Linus TorvaldsApr 16, 2005
  27. Thomas GleixnerApr 16, 2005
  28. David LangApr 16, 2005
  29. Ingo MolnarApr 16, 2005
  30. David WoodhouseApr 17, 2005
  31. Petr BaudisApr 17, 2005
  32. David WoodhouseApr 18, 2005
  33. Petr BaudisApr 18, 2005
  34. David WoodhouseApr 18, 2005
  35. Petr BaudisApr 18, 2005
  36. David WoodhouseApr 18, 2005
  37. Petr BaudisApr 18, 2005
  38. Linus TorvaldsApr 18, 2005
  39. David WoodhouseApr 18, 2005
  40. Catalin MarinasApr 18, 2005
  41. David MansfieldApr 18, 2005
  42. Catalin MarinasApr 19, 2005

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.