aboutsummaryrefslogtreecommitdiff
path: root/pack-objects.c
Commit message (Collapse)AuthorAge
* git-pack-objects: write the pack files with a SHA1 csumLinus Torvalds2005-06-26
| | | | | | | | | | We want to be able to check their integrity later, and putting the sha1-sum of the contents at the end is a good thing. The writing routines are generic, so we could try to re-use them for the index file, instead of having the same logic duplicated. Update unpack-objects to know about the extra 20 bytes at the end of the index.
* git-pack-objects: use name information (if any) to sort objects for packing.Linus Torvalds2005-06-26
| | | | This is incredibly cheezy. But it's cheap, and it works pretty well.
* git-pack-objects: do the delta search in reverse size orderLinus Torvalds2005-06-26
| | | | | | | | | | | Starting from big objects and going backwards means that we end up picking a delta that goes from a bigger object to a smaller one. That's advantageous for two reasons: the bigger object is likely the newer one (since things tend to grow, rather than shrink), and doing a delete tends to be smaller than doing an add. So the deltas don't tend to be top-of-tree, and the packed end result is just slightly smaller.
* Fix object packing/unpacking.Linus Torvalds2005-06-26
| | | | | | | This actually successfully packed and unpacked a git archive down to 1.3MB (17MB unpacked). Right now unpacking is way too noisy, lots of debug messages left.
* [PATCH] Finish initial cut of git-pack-object/git-unpack-object pair.Junio C Hamano2005-06-26
| | | | | | | | | | | | | | | | | This finishes the initial round of git-pack-object / git-unpack-object pair. They are now good enough to be used as a transport medium: - Fix delta direction in pack-objects; the original was computing delta to create the base object from the object to be squashed, which was quite unfriendly for unpacker ;-). - Add a script to test the very basics. - Implement unpacker for both regular and deltified objects. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Add "--depth=N" parameter to git-pack-objects to limit maximum delta depthLinus Torvalds2005-06-25
| | | | It too defaults to 10. A nice round random number.
* git-pack-objects: make "--window=x" semantics more logical.Linus Torvalds2005-06-25
| | | | | | | | | | | A zero disables delta generation (like before), but we make the window be one bigger than specified, since we use one entry for the one to be tested (it used to be that "--window=1" was meaningless, since we'd have used up the single-entry window with the entry to be tested, and had no chance of actually ever finding a delta). The default window remains at 10, but now it really means "test the 10 closest objects", not "test the 9 closest objects".
* Add a "max_size" parameter to diff_delta()Linus Torvalds2005-06-25
| | | | | | | Anything that generates a delta to see if two objects are close usually isn't interested in the delta ends up being bigger than some specified size, and this allows us to stop delta generation early when that happens.
* Fix delta "sliding window" codeLinus Torvalds2005-06-25
| | | | | | | | | When Junio fixed the lack of a successful error code from try_delta(), that uncovered an off-by-one error in the caller. Also, some testing made it clear that we now find a lot more deltas, because we used to (incorrectly) break early on bogus "failure" cases.
* [PATCH] (patchlet) pack-objects.c: try_delta()Junio C Hamano2005-06-25
| | | | | | | | | Return value of try_delta is checked for negativeness, but the success path does not return anything, letting compiler warn and presumably return garbage. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* git-pack-objects: mark the delta packing with a 'D'.Linus Torvalds2005-06-25
| | | | | | When writing a delta, we take the real type from the object we're doing the delta against, and just write a 'D' as the type of the current object.
* git-pack-objects: fix typoLinus Torvalds2005-06-25
| | | | ("<" should be "=")
* git-pack-objects: create a packed object representation.Linus Torvalds2005-06-25
This is kind of like a tar-ball for a set of objects, ready to be shipped off to another end. Alternatively, you could use is as a packed representation of the object database directly, if you changed "read_sha1_file()" to read these kinds of packs. The latter is partiularly useful to generate a "packed history", ie you could pack up your old history efficiently, but still have it available (at a performance hit, of course). I haven't actually written an unpacker yet, so the end result has not been verified in any way yet. I obviously always write bug-free code, so it just has to work, no?