Re:Project Gitenberg
by spain on Saturday August 23, 2014 @01:05AM
(#8215056)
+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.
[ Parent
| on HN ]
I 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.
Indeed. 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.
Perhaps "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).