Take a diff by sentence, not just by line.
When you’re dealing with written text, rather than code, your line breaks only come at the end of paragraphs. Those are pretty large chunks to diff based on. It’s not uncommon for me to send something to someone, have them edit it simply by changing it to how they want it, and then have every sentence change. This renders diff useless.
Instead, sent diff first puts a line break after every sentence (in a temporary file. It leaves the original file as is.) so that if diffs based on a smaller quantum.
sentdiff.rbfile. In the directory where it is, run:
chmod +x sentdiff.rb sudo cp sentdiff.rb /usr/bin/sentdiff
After installing, simply run:
sentdiff [params that get passed to diff] filename1 filename2
It will do a diff by sentence between file1 and file2.
filename1 and filename2 must be your last two params, but you may give any number (including 0) params before that it will just pass right on to diff. (This should be the same as how diff works. The idea is that you anywhere you used diff before, you should be able to sue sentdiff and have it do the same thing, but diffing by sentence.)
Please report bugs on the wiki
Or want to fix a bug? Make it better! Fork it!