Menu

#133 Add an option to use the patience diff algorithm

open
nobody
None
5
2012-09-30
2012-09-30
No

There is an algorithm called "patience diff" that "focuses its energy on the low-frequency high-content lines which serve as markers or signatures of important content in the text" (source: http://bryanpendleton.blogspot.ca/2010/05/patience-diff.html). This property helps produce better diffs when the file has changed significantly (for example, a function was moved).

I have used patience diff as part of git, using git diff --patience. I used it when git's default diff algorithm produced undesirable results.

Patience diff would be very helpful when merging. It is important that corresponding lines are matched correctly when merging, otherwise you end up having to use manual alignment (which resets the output in KDiff3; annoying when you realize in the middle of a merge that you need to use it!).

I suggest that this be an option, rather than replacing completely the current diff algorithm, because I don't know if patience diff could sometimes be worse than the current algorithm.

Discussion