dot/gitconfig.in: Define a plausible word-diff regexp.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 31 Jan 2012 00:30:15 +0000 (00:30 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 31 Jan 2012 00:34:22 +0000 (00:34 +0000)
Match sequences of alphanumerics and loose non-space punctuation.  This
seems to give relatively good results on plain text with colour output.
Picking out differences in code might be harder, but line-based diffs
work better in such cases anyway: word diff is useful precisely because
it works well on reflowed text, and that's more likely to happen in a
text document than in code.

dot/gitconfig.in

index 5ea026a..77976f9 100644 (file)
@@ -19,6 +19,7 @@
 
 [diff]
        renames = copies
+       wordRegex = [[:alnum:]]+|[^[:space:][:alnum:]]
 
 [diff "lisp"]
        xfuncname = "^\\s*\\(def.*$"