From: Mark Wooding Date: Tue, 31 Jan 2012 00:30:15 +0000 (+0000) Subject: dot/gitconfig.in: Define a plausible word-diff regexp. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/ca475e8dafc4e338e4c35436ea53ff644ba4c0d6 dot/gitconfig.in: Define a plausible word-diff regexp. 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. --- diff --git a/dot/gitconfig.in b/dot/gitconfig.in index 5ea026a..77976f9 100644 --- a/dot/gitconfig.in +++ b/dot/gitconfig.in @@ -19,6 +19,7 @@ [diff] renames = copies + wordRegex = [[:alnum:]]+|[^[:space:][:alnum:]] [diff "lisp"] xfuncname = "^\\s*\\(def.*$"