From: Johannes Schindelin Date: Mon, 05 May 2008 12:14:44 GMT Subject: Re: [PATCH v2 4/5] Make boundary characters for --color-words configurable Message-ID: In-Reply-To: Hi, On Sun, 4 May 2008, Jakub Narebski wrote: > Junio C Hamano writes: > > > Let's step back a bit and try to clarify the problem with a bit of > > illustration. > > > > The motivation behind "word diff" is because line oriented diff is > > sometimes unwieldy. > > > > -Hello world. > > +Hi, world. > [...] > > We instead can do this word by word (note that I am doing this as a > > thought experiment, to illustrate what the problem is and what should > > conceptually happen, not suggesting this particular implementation): > > > > preimage postimage word-diff > > 48656c6c6f -48656c6c6f Hello > > 4869 +4869 Hi > > 2c +2c , > > 20 20 20 ' ' > > 776f726c64 776f726c64 776f726c64 world > > 2e 2e 2e . > > 0a 0a 0a '\n' > > > > Which would give you "/Hello/Hi,/ world.\n". > > Would it be possible instead of in-line word diff, use word coloring > to enhance traditional diff format? Something like > > -/Hello/ world. > +/Hi,/ world. > > (We could use bold, or reverse for marking changed fragment, or use > color only for changed fragment). > > IMHO current output is nice, unless you have long lines and not very > wide screen... -S ;-) IIRC the code to display was not too complicated for the current mode, so it should be relatively simple for the mode you desire. But first let's agree on the semantics of the "tokens", as Junio calls them, okay? Ciao, Dscho