bup-margin(1)
π bup-margin(1) π
okay bestie, welcome to bup-margin β the little tool that goes "hey, how much room do we actually have before this whole dedup thing starts colliding?" π¦
β¨ NAME β¨
bup-margin β figure out your deduplication safety margin π
πΈ SYNOPSIS πΈ
bup margin [options...]
π DESCRIPTION π
so here's the vibe: bup margin goes through every single object in your bup repository and figures out the largest number of prefix bits shared between any two entries. that number is called n, and it's literally the longest subset of SHA-1 you could get away with using and still run into a collision between your object ids. π
for example, one system that got tested had a collection of 11 million objects (that's 70 GB, no cap), and bup margin returned 45. which means a 46-bit hash would be enough to dodge all collisions among that set of objects β each object in that repository could be uniquely identified by its first 46 bits. iconic. β¨
the number of bits needed seems to go up by about 1 or 2 for every doubling of the number of objects. and since SHA-1 hashes have 160 bits, that leaves a whole 115 bits of margin. π«Ά of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. so like, don't stress too hard.
if you're paranoid about the possibility of SHA-1 collisions (valid tbh), you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. π
π OPTIONS π
--predictβ guesses the offset into each index file where a particular object will appear, and reports the maximum deviation of the correct answer from the guess. potentially useful for tuning an interpolation search algorithm. tuning era fr fr π₯--ignore-midxβ don't use.midxfiles, use only.idxfiles. this is only really useful when used with--predict.
π EXAMPLES π
$ bup margin
Reading indexes: 100.00% (1612581/1612581), done.
40
40 matching prefix bits
1.94 bits per doubling
120 bits (61.86 doublings) remaining
4.19338e+18 times larger is possible
Everyone on earth could have 625878182 data sets
like yours, all in one repository, and we would
expect 1 object collision.
$ bup margin --predict
PackIdxList: using 1 index.
Reading indexes: 100.00% (1612581/1612581), done.
915 of 1612581 (0.057%)
π¦ SEE ALSO π¦
π BUP π
part of the bup(1) suite. family reunion energy π«Ά
π AUTHORS π
Avery Pennarun <apenwarr@gmail.com>
and that's the whole page, bestie! π
okay so the lore: this is from Bup 0.34, dated 2026-09-01, and it's the bup-margin(1) manual page β a real one, from the General Commands Manual, no cap. go forth and check your margin, main character. πβ¨
π¦ where this page comes from
- fedora 44: bup 0.34-1.fc44 Β· LGPL-2.0-only
- nixpkgs unstable: bup 0.34
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms