Diff tool for finding a minimal set of changes

1

I have two versions of a text file, with many changes (including whitespace, linebreak differences, etc.). All of the diff tools I have tried (diff, diff --minimal, wdiff, kdiff3, meld) fail spectacularly to even come close to properly aligning the two versions (it seems that they start lining things up from the beginning of the file, and once they are "out of sync", they never get back on track). Actually, the best diff tool I've found for this pair of files is the diff displayed inside gitk, but I don't know how to call it externally (and it is anyway only passable).

Is there any diff tool which will find a minimal set of changes between two files? (e.g. by using dynamic programming)

I am most interested in tools available on linux.

John Pardon

Posted 2019-09-03T16:08:58.633

Reputation: 111

Be aware that the difftool and algorithm chosen are orthogonal, though some tools may have algorithms not natively present in git. Have you tried git diff --diff-algorithm=histogram? – MooseBoys – 2019-09-23T16:44:07.400

Answers

1

If we speak about Windows GUI differs, I have to say:

  • Most of modern diff-tools (which I saw and tried) have in settings (configurable) ignore "EOL|Whitespace changes"
  • Most of modern diff-tools can show inline changes (for not-ignored content)

P4Merge can detect (and show in interface in clean form) inserted|deleted chunks, do not converting into mess the rest part of file

CompareIt! have even more wide set of ignorable changes and concept of different "comparison profiles", regexps processing (didn't try yet, can't comment), "moved blocks" detection (and it works)

Lazy Badger

Posted 2019-09-03T16:08:58.633

Reputation: 3 557

0

Notepad++ has a comparison tool that works quite well for me. It seems to do a really good job of identifying the matches and calling out the true differences. Notepad++ is free to download and a very useful software for a myriad of other reasons as well.

https://notepad-plus-plus.org/

Lumberjack

Posted 2019-09-03T16:08:58.633

Reputation: 221

Please add the plugin name, its website, if its open source then also add the repository name and link. No need to reply this comment. – Biswapriyo – 2019-09-03T16:35:57.353