Re: [PATCH v2] make diff --color-words customizable
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 13, 2009, 00:40 UTC
- Message-ID
- <alpine.DEB.1.00.0901130140360.3586@pacific.mpi-cbg.de>
- In-Reply-To
- <200901130059.19511.jnareb@gmail.com>
Hi,
On Tue, 13 Jan 2009, Jakub Narebski wrote:
Show 31 quoted lines
> On Sat, 10 Jan 2009, Johannes Schindelin wrote: > > On Sat, 10 Jan 2009, Jakub Narebski wrote: > >> On Sat, 10 Jan 2009, Johannes Schindelin wrote: > >>> On Sat, 10 Jan 2009, Jakub Narebski wrote: > >>>> Thomas Rast wrote: > >>>> > >>>>> --color-words works (and always worked) by splitting words onto one > >>>>> line each, and using the normal line-diff machinery to get a word > >>>>> diff. > >>>> > >>>> Cannot we generalize diff machinery / use underlying LCS diff engine > >>>> instead of going through line diff? > >>> > >>> What do you think we're doing? libxdiff is pretty hardcoded to newlines. > >>> That's why we're substituting non-word characters with newlines. > >> > >> Isn't Meyers algorithm used by libxdiff based on LCS, largest common > >> subsequence, and doesn't it generate from the mathematical point of > >> view "diff" between two sequences (two arrays) which just happen to > >> be lines? It is a bit strange that libxdiff doesn't export its low > >> level algorithm... > > > > Umm. > > > > It _is_ Myers' algorithm. It just so happens that libxdiff hardcodes > > newline to be the separator. > > So amd I to understand that _exported_ functions hardcode separator > to be newline (most probably for performance), and there is no function > in libxdiff which calculates LCS, or returns diff for arrays > (sequences)?
That is my understanding, yes.
Ciao, Dscho