On Sun, Nov 12, 2006 at 04:18:29PM +0200, Yuval Kogman wrote:
> On Fri, Nov 10, 2006 at 09:39:08 -0800, David Roundy wrote:
> > What do you mean by noisy? Or "false" changes? I have no idea what you are
> > talking about (which would make it hard to fix).
>
> Here is an example I get often:
>
> hunk ./lib/MO/Compile/Attribute/Simple/Compiled.pm 75
> -sub _generate_accessor_method {
> +sub slot {
> Shall I record this change? (7/?) [ynWsfqadjkc], or ? for help: y
> hunk ./lib/MO/Compile/Attribute/Simple/Compiled.pm 78
> - my $slot = ( $self->slots )[0];
> + my @slots = $self->slots;
> +
> + warn "Attribute $self has more than one slot, but the
> generated accessor will only use the first one" if @slots > 1;
> +
> + return $slots[0];
> +}
> +
> +sub _generate_accessor_method {
> + my $self = shift;
>
>
> The patch I would have expected is [hand typed]:
>
>
> +sub slot {
> + my @slots = $self->slots;
> +
> + warn "Attribute $self has more than one slot, but the
> generated accessor will only use the first one" if @slots > 1;
> +
> + return $slots[0];
> +}
>
> sub _generate_accessor_method {
> my $self = shift;
> - my $slot = ( $self->slots )[0];
> + my $slot = $self->slot;
>
>
> which represents much more closely the actual change. Since this
> always seemed to me like nitpicking which is very hard to solve I
> never complained.In your example you left out a + on the space between the two subroutines. But it does look like in this example darcs doesn't generate a true LCS, as even with the added line, darcs is generating a non-minimal diff. This would be a result of a performance improvement, which was added because a true LCS takes O(N^2) time (which is problematic for people with multi-megabyte text files). Perhaps we should have a heuristic that allows us to use a true LCS on smaller files. (Note that if there was a whitespace change in the _generate_accessor_method line, then darcs did make an optimal choice). The algorithm darcs now uses, by the way, is the same one used by GNU diff. (But not original diff, which used a true LCS, but scaled worse than GNU diff.) There's also often an ambguity in deciding which lines were added where, and there's no way to determine what the user means. We've tried to use a heuristic to (among equivalently minimal descriptions of a change) select a reasonable change, but it's tricky, as the "best" choice is often very different, depending on -- David Roundy Dept. of Physics Oregon State University
signature.asc
Description: Digital signature
_______________________________________________ darcs-users mailing list [email protected] http://www.abridgegame.org/mailman/listinfo/darcs-users
