[darcs-users] Re: Pin-based branching & merging
David Roundy
droundy at abridgegame.org
Tue Aug 10 09:16:52 UTC 2004
(On the pinning email, I haven't gotten around to reading it, which will
obviously take some time and thought.)
On Mon, Aug 09, 2004 at 04:56:07PM -0400, Andrew Pimlott wrote:
> [1] My understanding is that darcs applies hunks by line number only,
> so that the contents of the removed lines in hunk patches are redundant;
> unlike most systems, which use the contents of removed lines and
> (possibly) context lines to apply hunks, and therefore may get confused
> when file contents move around or context changes. However, this
> confusion may be viewed as conservatism in automatically resolving
> conflicts, which may be viewed as a safety feature. David, is this
> accurate?
I'm not sure I parsed your statement correctly. Yes, the removed lines in
hunk patches are redundant (although they do get checked, which helps in
bringing to light corruption in a repository). So when a chunk of text is
"moved" darcs treats that as two separate changes, an addition and a
removal, which can end up not doing what you want. On the other hand,
because it doesn't do any "approximate" matching, based on context or
whatever, you don't have to worry (for example) about a patch to one
function being accidentally applied to a different (but similar) function
in the same file, just because there was a conflicting change in the
original function.
So in general, darcs doesn't silently merge patches that ought to
conflict. Of course, there's nothing it (or any other system except a
complete refactoring system) can do about "logical" changes that may
conflict only in the sense that they cause bugs (e.g. renaming a variable
via a hunk patch merged with a new instance of that variable in a second
patch).
--
David Roundy
http://www.abridgegame.org
More information about the darcs-users
mailing list