Diff that splits the files by sentences first. Made for editting text with somewhat-long paragraphs
Pull request Compare This branch is 2 commits behind jackowayed:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
COPYING
README.textile
sentdiff.rb

README.textile

Sent Diff

Diff for Writing

Take a diff by sentence, not just by line.

Why?

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.

Install

Download the

sentdiff.rb
file. In the directory where it is, run:

chmod +x sentdiff.rb
sudo cp sentdiff.rb /usr/bin/sentdiff

Usage

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.)

Bugs

Please report bugs on the wiki

Think it sucks?

Or want to fix a bug? Make it better! Fork it!