disu.se

DiffModule

Namespace

Lookout

Namespace for the “diff” subsystem. Includes various algorithms for generating “diffs” and output formats for displaying them. Used by Difference to generate meaningful “diffs” of objects.

A “diff” is a sequence of Operations that describe how to turn an old/original/from version of a structure, such as an ::Array, to a new/new/to version of that structure. For example, if the old version of an Array is [1, 2, 3] and the new version of that array is [1, 2, 3, 4], then the “diff” is a sequence of operations containing one operation, the insertion of the element 4 at the end of the Array.

A “diff” is generated by one of various Algorithms that calculate optimal sequences of operations, for some definition of “optimal”. A common goal is to provide the shortest sequence of operations necessary, but providing a sequence that “feels natural” to a human is often also a priority. The algorithms work by looking for Matches between Slices of the sequences and then turning the information provided by these matches into the operations that describe the changes that need to be made.

“Diffs” can be turned into quite a few different textual Formats for display to a human. Such formats may Group together related Groups of operations, focusing the display on the actual differences.

You can find more information about “diffs” at http://en.wikipedia.org/wiki/Diff.

Children

Algorithms

Namespace for “diff” algorithms.

Formats

Namespace for “diff” output formats.

Group

Ordered sequence of related Operations; type enumerated by Groups.

Groups

Sequence of Operations bundled together into Groups that can then be used to show the subsequences that differ, folding away the subsequences that are the same, only keeping some context around the folding points.

Match

Matching pair of Slices of the sequences being “diffed”.

Operation

Base class for operations describing the changes to perform to get from the old version of a sequence to the new in a “diff”.

Operations

Sequence of Operations based on a sequence of Matches.

Slice

Slice (subsequence) of a sequence being “diffed”.