3 ms·
Patience diff cares about lines that only appear once in each file. The idea behind that heuristic is that lines that only appear once are more likely to repres
by ufo 6y ago
Patience diff cares about lines that only appear once in each file. The idea behind that heuristic is that lines that only appear once are more likely to represent the parts of the document that don't belong to the diff. Conversely, if a line appears more than once in the file then it is more likely to be something like a blank line or a " }", where a match in the two documents might be just a coincidence. That particular example is one where the heuristic doesn't work well. The big block of abcs doesn't have any unique lines so patience diff doesn't see much cost in including it as part of the diff.
OP's blog has another series of posts about patience diff. They are also an interesting read: https://blog.jcoglan.com/2017/09/19/the-patience-diff-algorithm/ https://blog.jcoglan.com/2017/09/19/the-patience-diff-algori...