Is there a diff algorithm that does not group unrelated blocks?
For example:
hello world
lorem ipsum dolor sit amet
vs.
Hello World
Lorem Ipsum Dolor Sit Amet
Comparing these (e.g. with standard Unix diff
) generally results in the following:
< hello world
< lorem ipsum dolor sit amet
---
> Hello World
> Lorem Ipsum Dolor Sit Amet
However, a line-by-line comparison like the following would seem more sensible:
< hello world
---
> Hello World
< lorem ipsum dolor sit amet
---
> Lorem Ipsum Dolor Sit Amet
The latter, IMO, makes it much easier to analyze minor changes. (Note that I'm concerned with human readability here, not machine readability.)
I understand diff'ing is a complex issue, but this often leaves me puzzled nonetheless.