Open tomwhoiscontrary opened 11 months ago
Thanks for the repro. That does look wrong, the result is far from the most minimal diff, which is what difftastic should be producing.
The expected diff should be more like this:
This looks like a bug with the 'split unchanged' logic, as the main differ is seeing three separate things to diff. The problem disappears with DFT_DBG_KEEP_UNCHANGED=y
, although I don't recommend this debug setting in general (it's crucial for performance).
(1) A description of the issue. A screenshot is often helpful too.
I have a Java source file with various changes, including a small change in the middle of a large method, including extracting some code into a new method which comes immediately after the large method. When i diffed my change, i was surprised to see that the whole large method was shown as deleted and re-added, so that the diff could line up some common parts in the old version of the large method and the new extracted method.
See this diff from difft:
And this one from diff -u, which is much smaller:
(2) A copy of what you're diffing.
See attached (you will need to rename these to remove the .txt):
(3) The version of difftastic you're using (see
difft --version
) and your operating system.