Module ddiff

Source
Expand description

DDiff is a diff between diffs. The type aids in the review of a Patch to a project by providing useful context between Patch updates a regular Diff will miss.

For example, lets start with a file containing a list of words.

componentwise
reusing
simplest
crag
offended
omitting

Where a change is proposed to the file replacing a set of lines. The example includes the HunkHeader “@ .. @” for completeness, but it can be mostly ignored.

@@ -0,6 +0,6 @@
componentwise
reusing
-simplest
-crag
-offended
+interpreters
+soiled
+snuffing
omitting

The author updates the Patch to keep ‘offended’ and remove ‘interpreters’.

@@ -0,6 +0,6 @@
componentwise
reusing
-simplest
-crag
 offended
-interpreters
+soiled
+snuffing
omitting

The DDiff will show the what changes are being made, overlayed on to the original diff and the diff’s original file as context.

@@ -0,9 +0,8 @@
  componentwise
  reusing
 -simplest
 -crag
--offended
+ offended
-+interpreters
 +soiled
 +snuffing
  omitting

An alternative is to review a Diff between the resulting files after the first and second Patch versions were applied. The first Patch changes and original file contents are one making it unclear what are changes to the Patch or changes to the original file.

@@ -0,9 +0,8 @@
 componentwise
 reusing
+offended
-interpreters
 soiled
 snuffing
 omitting

Structs§

DDiff
A diff of a diff.
FileDDiff
The DDiff version of FileDiff.

Enums§

DiffModification
Either the modification of a single diff Line, or just contextual information.