[darcs-users] Why adjacent (not overlapping) hunks depends on each other?

Ganesh Sittampalam ganesh at earth.li
Wed Nov 13 06:24:13 UTC 2013


Hi,

On 12/11/2013 18:06, Vincent Zweije wrote:

> On Tue, Nov 12, 2013 at 01:50:25PM +0100, Tommy Pettersson wrote:

> ||          If we try to pull them together in yet another clone of
> ||  the original repo, the first hunk we pull will go to this line
> ||  number. But what about the second hunk? It wants to go to the
> ||  same line nuber, and it knows nothing about the hunk that is
> ||  already there. Should we put it before or after?
> 
> Suppose hunk A replaces lines [A1:A2), and hunk B replaces lines [A2:A3).
> 
> These hunks are adjacent. However, their relative order in the file is
> undetermined only if A1 = A2 = A3. So only hunks that remove no lines
> must be ordered by a dependency (and conflict if they don't have one).
> 
> For symmetry reasons I suspect it may be necessary that the same may
> hold for hunks that only remove lines, but I haven't thought this
> through thoroughly.

Yes, if two patches both add and remove lines, then darcs will allow
them to commute even if they touch.

In fact I think darcs is a bit too strict - I believe that it's enough
if *one* of the patches both adds and removes lines - but we can't
change the rule now without breaking compatibility, so it'll have to
wait for a new patch format.

Cheers,

Ganesh


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 371 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20131113/c7b9233d/attachment.asc>


More information about the darcs-users mailing list