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

Tommy Pettersson ptp at lysator.liu.se
Tue Nov 12 12:50:25 UTC 2013


On Fri, Nov 08, 2013 at 08:12:29AM +0100, Gian Piero Carrubba wrote:
> While reading Darcs Using/Model[0], I noticed the following:
> 
>      We’ve been asked before why it’s important for adjacent hunks to 
>      depend on each other. TODO: do we know why? David said so once in 
>      person, but I didn’t understand it at the time – EYK
> 
> It would be great if someone knowing the answer could modify the page 
> writing down the explanation.

It's hard to explain in an easy way, so here goes an example.

If adjacent hunks were allowed to commute, we could do this:

1. Clone a repo a number of times.

2. Create a set of adjacent hunks in the first repo.

3. Pull a different one of these adjacent hunks to each of the
   cloned repos.

Now, each of these pulled hunks will start at the same line
number. 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?

The solution is to not allow adjacent hunks to commute, so they
will always be pulled in the same order, and lines will always
be put in the right place.

-- 
Tommy Pettersson <ptp at lysator.liu.se>


More information about the darcs-users mailing list