3 ms·
+1, in code the basic unit is usually a line, but in prose it is the sentence. I've tried using git with LaTeX and it always ended up with weird situations wher
by spain 12y ago
+1, in code the basic unit is usually a line, but in prose it is the sentence. I've tried using git with LaTeX and it always ended up with weird situations where you had to put each sentence on a different line to make it work effectively.
- azernik 12y agoI think this could be made easier by using the git database as a substrate - there's nothing in that that's tied to line-oriented files (maybe the compression algorithms make some assumptions?). It's the diff-viewing infrastructure that needs to be completely replaced for prose.
- zwp 12y agoPerhaps "git diff --word-diff" helps? I don't see a similar option for "git show" though and that seems important :( I think you're right: if the diff-viewing infrastructure was abstracted (plugin?) it could do this and more (eg word-diff-by-paragraph, image-diff).
- davvid 12y agoIndeed. git diff --color-words will often do the trick for prose, but the real solution is plugging a sentence-oriented diff viewer into git difftool. git difftool is extendable by setting git config variables, so it's very much doable.