[darcs-users] handling of conflicts?

David Roundy droundy at abridgegame.org
Mon Mar 22 15:35:46 UTC 2004


On Mon, Mar 22, 2004 at 04:36:28PM +0100, Andres Loeh wrote:
> > On Mon, Mar 22, 2004 at 03:57:17PM +0100, Andres Loeh wrote:
> > > { At this point, I decide that the correct resolution to this
> > > conflict is to remove both offending lines, bar and add. }
> > > 
> > > ~/darcs.2 $ rm test && touch test
> > > ~/darcs.2 $ darcs whatsnew --look-for-adds
> > > No changes!
> > > 
> > > In this case, I really see no way to confirm the resolution
> > > of the conflict with darcs. If I would pull this repo to another
> > > location, I would still get the conflict ...
> 
> > Better than this would be to record an empty patch that depends
> > (--ask-depends) on both conflicting patches.  This currently can't be done,
> > because record will refuse to record an empty patch.  But it suggests a way
> > out (eventually), which would be to perhaps introduce a "resolve" command
> > that would record such a patch for you, and might also interactively let
> > you browse the conflicts and select from a few reasonable resolutions.
> > I've long thought that such a command would be good to implement, but
> > haven't gotten around to doing so, partly for technical reasons, but
> > largely because I don't like writing interactive commands.
> 
> Thanks again for pointing out these possibilities.
> 
> Couldn't the pull leave an additional change in the current repo,
> such that the output of "darcs whatsnew" might be:
> 
> $ darcs whatsnew
> {
> resolve-conflict ./test
> hunk ./test 1
> +bar
> +foo
> }
> 
> In addition to whatever change would be deemed appropriate to resolve
> the conflict, I always can record the "symbolic" conflict-resolution.
> This would be the same as to manually record the patch with the
> dependency, only that darcs helps me to do so, by providing the
> special "resolve-conflict" change.
> 
> It also has the advantage, that during the next "darcs record", I am
> pointed at the fact again that there had been a conflict, and it
> becomes less likely that I record a resolution I don't want ...
> 
> Do I make myself clear here? I am not sure ...

Yes, something like that would be nice.  The trick would be to figure out
the commutation behavior of resolve-conflict.  I think that probably it
would be best for resolve-conflict actually include the merger information
indicating what the conflict was that needed resolving.  Then if there are
two conflicts to a single file, you could record a change resolving one of
them, but not the other.  It also could make it much easier to write a
"resolve" command, since it could just look at pending to see what needs
resolving (with a flag to tell it to look for deeper conflicts, in case you
reverted the resolve-conflict patch).

This does sound like a good idea, but my plan is to avoid introducing any
new patch types until after darcs 1.0 is released... While the current
conflict-handling isn't very user friendly, it also doesn't include any
bugs that I know of.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list