[darcs-users] Hunk merging and interactive edit
ganesh at earth.li
Mon May 2 08:33:11 UTC 2011
On 02/05/2011 07:51, Stephen J. Turnbull wrote:
> Ganesh Sittampalam writes:
> > The main issue here, which is of getting the "right" hunks to be
> > recorded, is really orthogonal to separating changes.
> I disagree. Indeed there are aspects of correctly specifying hunks
> that will be independent of change separation (as in the example of
> adding a whole function that you give), but the issue of whether
> abutting blocks of changes should be recorded as one hunk or multiple
> hunks clearly depends on the intent of the author, ie, change
Looking at the original poster's example again, I think because it was
adding a argument to foo, the changes do turn out to be abutting. If
that hadn't been the case, I think darcs might well still have picked
the "wrong" set of hunks because of the closing bracket confusion.
Picking the right hunks is as interesting problem that goes right to the
heart of the tree-based vs patch-based design choice; in each case a
heuristic is applied to decide what the changes "really" were, but in a
tree-based system it happens when merging whereas in a patch-based
system it happens at record time. Doing it early means that it's more
likely that you'll capture the real intent of the user, *if* you make it
easy for them to communicate that intent. If you the wrong thing is
recorded initially, then you're forever screwed.
As we develop more sophisticated kinds of patch, we'll need to get the
UI right for that.
More information about the darcs-users