RFC: idioms/names for delta vs changes

Robert Collins robertc at robertcollins.net
Wed Nov 12 22:01:36 GMT 2008


So we have throughout the bzrlib code base two similar concepts (and
many variations of each for different objects and so on).

One that is a recipe for regenerating an instance B from some inputs. We
usually call this a delta. Its not reversible (you can't get to the
inputs given B and the recipe).

One that is a symmetric description of changes between instance A and
instance B. We don't seem to have a consistent name for this, but we do
have 'iter_changes' on trees. Unidiff patches are symmetric in this
fashion.

Why two things? For serialisation at least, a delta is often much more
efficient than a 'changes'. knits are slightly more efficient than
unidiff style patches, but groupcompress is much more efficient than
knits. Neither are reversible. The reversible aspect only matters if we
want to be able to traverse in a bidirectional fashion (but this can be
surprisingly useful; symmetric deltas inside knits would have let us
handle deletes without full deserialisation years ago).

I think the situation is less clear than it could be. It might be a good
idea to set some nomenclature so that its clear when code is offering a
reversible interface (e.g. changes) or when its offering a 'permit later
regeneration' interface.

-Rob


-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081113/1265a5b1/attachment.pgp 


More information about the bazaar mailing list