]> arthur.barton.de Git - bup.git/commit
hashsplit: use shorter offset-filenames inside trees.
authorAvery Pennarun <apenwarr@gmail.com>
Sun, 20 Feb 2011 02:48:06 +0000 (18:48 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 20 Feb 2011 05:38:28 +0000 (21:38 -0800)
commitd130210ac92511773b54219aaed4253ea63ba3ac
tree81958cd90ae1dfaa1d7c05ddd650711c518b4782
parent48c6f484d8fdaf2dedcdb645e10c7fca2c164400
hashsplit: use shorter offset-filenames inside trees.

We previously zero-padded all the filenames (which are hexified versions of
the file offsets) to 16 characters, which corresponds to a maximum file size
that fits into a 64-bit integer.  I realized that there's no reason to
use a fixed padding length; just pad all the entries in a particular tree to
the length of the longest entry (to ensure that sorting
alphabetically is still equivalent to sorting numerically).

This saves a small amount of space in each tree, which is probably
irrelevant given that gzip compression can quite easily compress extra
zeroes.  But it also makes browsing the tree in git look a little prettier.

This is backwards compatible with old versions of vfs.py, since vfs.py has
always just treated the numbers as an ordered set of numbers, and doesn't
care how much zero padding they have.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
lib/bup/hashsplit.py