From: Davide Libenzi Date: Tue, 03 May 2005 05:30:17 GMT Subject: Re: RFC: adding xdelta compression to git Message-ID: In-Reply-To: On Mon, 2 May 2005, Linus Torvalds wrote: > Yes. EXCEPT for one thing. fsck. I'd _really_ like fsck to be able to know > something about any xdelta objects, if only because if/when things go > wrong, it's really nasty to suddenly see a million "blob" objects not work > any more, with no indication of _why_ they don't work. The core reason may > be that one original object (that just got used as a base for tons of > other objects through deltas) is corrupt or missing. And then you want to > show that _one_ object. Linus, xdelta-based algorithms already stores informations regarding the object that originated the diff. Since they have no context (like text-based diffs) and are simply based on offset-driven copy/insert operations, this is a requirement. Libxdiff uses an adler32+size of the original object, but you can get as fancy as you like in your own implementation. Before a delta patching, the stored information are cross checked with the input base object, and the delta patch will fail in the eventuality of mismatch. So an fsck is simply a walk backward (or forward, depending on your metadata model) of the whole delta chain. - Davide