[darcs-users] Dealing with File Addition Conflicts

Curt Sampson cjs at starling-software.com
Tue Jun 24 00:26:49 UTC 2008


On 2008-06-23 22:21 +0100 (Mon), Eric Y. Kow wrote:

> Oh, that's normal! In the darcs pristine repository, what really happens
> when two patches conflict, neither of them has any effect.  It's as if
> file never existed in the first place.  This is done for theoretical
> reasons (as far as I can tell, it makes things very predictable).

Well, I'm quite new to Darcs, but data predictably disappearing is not
really what I'm normally looking for in a revision control system.

> For example, if you have two conflicting hunk patches in the same
> file, you get both their contents and the conflict markers. Whatever
> you do to merge will be recorded on top of context where the two
> conflicting patches never 'happened' in the first place (of course, it
> will depend on the two patches...Does that make any sort of sense?

I think that makes sense, yes. So basically, no matter what the state
of my working copy, I can always do a mark-conflicts to mark up any
conflicts that do not have a further patch depending on them?

If I understand this correctly, this basically brings the non-file-add
issue down to a UI issue: you have to be somewhat careful to check for
conflicts and resolve them before recording a patch.

My worry would be that one might, say, revert a conflicting file,
lose the record of the conflicts, and then unwittingly commit a patch
depending on the conflicting patches, thus essentially marking the
conflict as resolved, when it never really was. Subversion's marking
of conflicts and forcing you to use the "resolved" command to fix them
deals with this issue. (In fact, Subversion's interface for dealing with
conflicts, leaving one with a copy of each file as well as a merged
file, is pretty nice.)

> As for the first problem, (have 'two' but not 'one'). I'm guessing that
> darcs doesn't have a really a good way to deal with the problem of
> marking up file-add conflicts...

It's already dropping in an extra copy of the file; how hard can it be
to add a copy of the other file as well?

On 2008-06-23 22:37 +0100 (Mon), Eric Y. Kow wrote:

> Do you think it would be feasible for conflicting adds to be marked up
> sensibly?  I.e. in the working directory, one of the adds happens (seems
> easy), and both hunks get thrown in on top (maybe not so easy?)

As above, I'd say just write out two copies of the file, one from each
patch, and bingo, problem solved.

cjs
-- 
Curt Sampson       <cjs at starling-software.com>        +81 90 7737 2974   
Mobile sites and software consulting: http://www.starling-software.com


More information about the darcs-users mailing list