Word-by-word diffs in Git

I personally like all my LaTeX files wrapped at about 80 columns, with rare exceptions. Of course, I track them all with Git. I use Vim, so it’s really easy to rewrap a paragraph whenever I add or delete content from it. The sad thing is, it totally screws up my diffs!

Have you ever tried looking at the history for any page in Wikipedia? It’s beautiful, intuitive, and word-centered. Forget about lines, they’re not suitable for text. Words, however, are.

Example of the word-by-word diff in Wikipedia

Example of the word-by-word diff in Wikipedia

Well, version control systems use the line-by-line diffs, which don’t really help when comparing two versions of a text file. What to do now?

Read the rest of this entry »