On Sun, Nov 12, 2006 at 15:47:00 +0000, Jamie Webb wrote: > I suspect your hand-typed version is not quite correct: I think both > subs start with the line 'my $self = shift'. When Darcs encounters > that line in the new function, it matches it up with the existing > identical line.
Both are "correct" in that sense (i did have a small erro, as David noted). However, the OP mentioned that sometimes the algorithm behaves in a way which is suboptimal, even if correct. I wouldn't have complained unless the OP implied that svn et al somehow know to do this better ;-) > Darcs knows nothing about program structure, and so > doesn't know that it's moved the existing line into a different > function. Either set of edits look equally good, and it has no way of > knowing that you'd prefer the latter. Of course, I don't expect it to, but a "retry diffing" option in the interactive mode could be nice, whereby some parameters are cycled and the LCS is redone. That way I could choose the patch that best describes the high level change from a list of possibilities, or even manually tweak the patch. > Whether Darcs can be taught is another matter. It might help if the > diff algorithm at least favoured breaking hunks on blank lines > (actually, I can see an argument for /always/ starting a new hunk when > hitting a blank line). Maybe it could additionally avoid breaking the > indent structure if possible. I have a feeling stuff like that changes > the complexity from polynomial to exponential though... Indentation is tough, because most editors eliminate indentation on blank lines, too. I think that this favouring of blank lines is actually going to be bad for my code. Maybe double blank lines ;-) Anyway, this is obviously not a true solution, but maybe some sort of plugin could be used in the future. -- Yuval Kogman <[EMAIL PROTECTED]> http://nothingmuch.woobling.org 0xEBD27418
pgppYTGmc80Rg.pgp
Description: PGP signature
_______________________________________________ darcs-users mailing list [email protected] http://www.abridgegame.org/mailman/listinfo/darcs-users
