News for hackers. Stuff that matters.
Re:Difftastic, a structural diff tool that understands syntax by fragmede on Thursday March 21, 2024 @04:09PM (#39783772)
word diff gets you halfway without that complexity
Re:Difftastic, a structural diff tool that understands syntax by abdullahkhalids on Thursday March 21, 2024 @04:17PM (#39783845)
Do you mean the diff system inbuilt into Microsoft Word or Google docs etc?
Re:Difftastic, a structural diff tool that understands syntax by senknvd on Thursday March 21, 2024 @04:59PM (#39784340)
There is a --word-diff flag in git diff. It can also be customized using --word-diff-regex to possibly match sentences.
Re:Difftastic, a structural diff tool that understands syntax by abdullahkhalids on Thursday March 21, 2024 @05:08PM (#39784422)
I see. From the docs [1]

    --word-diff-regex=<regex> 

      ... A match that contains a newline is silently truncated(!) at the newline.
If I understand this correctly, if you use newlines inside a sentence (if you are writing a fixed width document, for example), this won't work.

[1] https://git-scm.com/docs/git-diff

Re:Difftastic, a structural diff tool that understands syntax by mzs on Thursday March 21, 2024 @05:48PM (#39784810)
pipe through "fmt -sw999999999999" first