From: Santi Béjar Date: Fri, 16 Jan 2009 00:10:34 GMT Subject: Re: [PATCH take 3 0/4] color-words improvements Message-ID: In-Reply-To: 2009/1/15 Johannes Schindelin : > On Thu, 15 Jan 2009, Junio C Hamano wrote: >> I didn't see the semantics of color-words documented in the original >> either, > [...] >> E.g. when these two are compared: >> >> bbb aaa bb aa b >> ccc aaa cc >> >> what should happen? We would want to say "aa" was removed by showing it >> in red, but on what background should it be displayed? cc aa >> b? > > If we are only ever interested in the 'a's, I'd say that the output should > only reflect that. In other words, what the current code does (ccc > aaaaa cc) is okay IMHO. After all, we said we're interested in > the 'a's, so we should not complain that it did not show us the removal of > 'b's. It may be ok and logical, but for me it is not what I want. Mmaybe I don't really undestand what I want or is a crazy idea but here it is anyway: Take a simple case with this two lines : matrix[a,b,c] matrix{d,b,c} there is no space so the standard color-words does not help to visualize that matrix, the b and c are not changed. What I currently do is to add some spaces: matrix[ a, b, c ] matrix{ d, b, c } then the color-words at least says that "b, c" is unchanged. What I would like is that --color-words would act as adding this spaces automatically (and even one after "matrix"). Or another way to think it could be: a) primary words are those with alphanumerics (or a regex) b) secondary "words" are the other non-whitespaces characters (in this case "[]{} and ," c) whitespaces are cruft. (having two regexp to specify what is a words but they cannot mix). If everything works as I think (it's late night :-) with the above two lines: matrix[a,b,c] matrix{d,b,c} the word diff would be matrix[{ad,b,c]} Santi