[darcs-users] Re: an interface for splitting hunks
Ian Lynagh
igloo at earth.li
Sat Apr 2 04:45:58 UTC 2005
On Wed, Mar 30, 2005 at 05:21:31PM +0200, Benedikt Schmidt wrote:
>
> Here is how the diff code i'm working on for darcs (similar to the one in
> GNU diff) creates the diff:
I should mention, I wrote a faster Hunt-Szymanski implementation a while
ago, but hadn't got around to mentioning it here yet. This doesn't solve
the complexity problems, of course, but it does speed things up. I don't
know if we want to go to a pure diff-like algorithm, or only do so if
H-S will be too slow (I think we can tell early on by looking at the
number of matching pairs and prompt the user if not told what to do by a
flag).
Anyway, the code is at
http://urchin.earth.li/~ian/cabal/lcs/
If nothing else you may find the testsuite useful :-)
I think this preference for having hunks in nice looking places can be
done by post-processing the output: if the end isn't nice then see if
you can push the hunk along one, repeatedly. For H-S you should only
need to do this in one direction, I think. I don't know about your
algorithm, but I'm sure for H-S this will be nicer (and more efficient)
than trying to hack the algorithm to find the right LCS in the first
place.
Thanks
Ian
More information about the darcs-users
mailing list