From: Santi Béjar Date: Wed, 14 Jan 2009 13:00:57 GMT Subject: Re: [PATCH 0/4] refactor the --color-words to make it more hackable Message-ID: In-Reply-To: 2009/1/11 Johannes Schindelin : > [...] > The basic idea is to decouple the original text from the text that is > passed to libxdiff to find the word differences. > > To that end, the words of the pre and post texts are put into two lists that > are fed to libxdiff. While the words are extracted, an array is created which > contains pointers back to the word boundaries in the original text. > Thanks. With this I will no longer need to add some spurious spaces in my latex files :-) I've tested and it seems to work, but there are some corner cases that it does not handle well. If you have this two files: ---8<--- pre h(4) a = b + c ---8<--- post h(4),hh[44] a = b + c aa = a aeff = aeff * ( aaa ) ---8<--- The "git diff" is okay, but not the "git diff --color-words", the addition of "aeff = ..." is not shown. Additionally with "git diff --no-index --color-words='^[A-Za-z0-9]*' the ']' character is not shown as an addition, and instead of the "aeff" line you get a ")" in green, as: h(4),{GREEN}hh[44{ENDGREEN}] a = b + c {GREEN}aa = a ){ENDGREEN} Also if the lost text is at the end the next "diff --git" line is printed in read: --8<--- #!/bin/bash git init cat > file < gfile < gfile <