News for hackers. Stuff that matters.
Re:Expanding Context in Diffs by gabemart on Monday December 02, 2013 @06:30PM (#6837384)
In text, hard line breaks can be content rather than presentation, so adding them to the raw file is not always desirable. It would be fantastic if the github web viewers offered this feature.

Also, won't it mess up diffs for wrapped text? If you add a few words in the middle of a paragraph and then re-wrap the text, won't the contents of every single following line be altered and show up as a diff?

Re:Expanding Context in Diffs by sdesol on Monday December 02, 2013 @07:40PM (#6837715)
Unified and side by side diffs were never really meant for diffing documents. If you do go the route of introducing line breaks to improve readability and/or editing, you really need to use a different diffing algorithm. What I've found useful is the Google diff match and patch library.

http://code.google.com/p/google-diff-match-patch/

Its extremely easy to integrate as well. You can see how it handles a markdown diff at:

http://ny.testdrive.gitsense.com/index?#pid=23&cid=27&trail=

Re:Expanding Context in Diffs by likeclockwork on Monday December 02, 2013 @08:24PM (#6837894)
git diff --word-diff