Simplified implementation of pack creation: PackWriter
commit7ab60b666c1eded6549aabfec846092cb24d8b2b
authorMarek Zawirski <marek.zawirski@gmail.com>
Sun, 15 Jun 2008 21:45:48 +0000 (15 23:45 +0200)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Sat, 28 Jun 2008 09:56:04 +0000 (28 11:56 +0200)
tree9ef112137231646ef7251a14cc9eff16867ba28b
parent5682ca21b94b8f10eeb5bfac3ecc8b7dbb18bb24
Simplified implementation of pack creation: PackWriter

This class is able to create a pack basing on provided objects
specification and options.

The core unimplemented feature comparing to the original
git-pack-objects is windowed delta searching algorithm (and needed
binary delta between 2 files).

This implementation can create an always correct pack, with
appropriate objects set and optimized order (as in original git).
Objects are written as whole objects or deltas to another objects (ref
or offset). Existing deltas and objects may be reused if set writer is
set up accordingly. Thin-packs and delta-depth options are also
supported.

Comparing to the original implementation, delta reuse is performed in a
slightly different way - allowing delta-chains longer than 2.
Delta-depth and delta-cycles are checked on-line when writing out
objects. These changes were introduced (possibly temporary) to give us
sensible pack creation implementation without binary delta generation
algorithm which is not yet implemented.

Mentored-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java [new file with mode: 0644]