[darcs-devel] hunk moves as a new kind of prim patch

Ganesh Sittampalam ganesh at earth.li
Thu Feb 15 06:48:19 UTC 2018


On 14/02/2018 23:34, Ben Franksen wrote:

> If we had primitive "hunk move" patches we could avoid conflicts in many
> cases.

I'd love to have this, and spent a while thinking about it some years
ago. I think the commute rules will be quite tricky to get right, as
there are lots of cases, e.g. overlaps between either source or
destination of the move. Getting the boundary conditions (do touching
patches commute or not) is also quite tricky even for hunk patches, but
we can err on the side of being conservative.

The way I was thinking about the commute rules before was to break the
move down into a "cut" and a "paste" operation - I don't think those
should be actual primitive patch types, but it helps to think about them
that way when working out the rules.

I think we'd definitely want moving between files as you mention, that
means you can really express code refactorings properly.

Cheers,

Ganesh


More information about the darcs-devel mailing list