[darcs-users] Re: What if darcs is generating too inclusive of hunks?

Benedikt Schmidt beschmi at cloaked.de
Tue Nov 14 00:09:24 UTC 2006


Lexington Luthor <Lexington.Luthor at gmail.com> writes:

> 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).
>
> While I can not say about that, the problem experienced by the
> original poster is something I have also experienced very often.
>
> Basically, when I am making changes to code (new feature), I might
> also make other changes near it which are unrelated (minor
> bug-fix). When it comes time to record darcs will (correctly) generate
> a diff containing both changes in a single hunk, and I have to
> manually edit the file to undo one of the changes, record it, and redo
> the changes and record the second change.

There have been some requests for "edit file" in darcs record before, do
you think something like this would work in this case:

1. darcs shows a hunk for Foo.hs, the user presses "e"

2. darcs opens an editor with a temporary copy of the file (evt. with
   markers for the hunk). You can do some changes, save the file and
   exit the editor

3. darcs recalculates the diff for this file (all other hunk choices for
   this file are invalidated, of course darcs could try to be more clever
   in this case, but i'm not sure if it's worth it since the new diff
   could be completely different from the old one).

4. darcs restarts the hunk selection process for Foo.hs

Since you only change a temporary file, your repo still contains both
changes, but you only recorded one of them.

Benedikt





More information about the darcs-users mailing list