[MERGE] auto-resolve for commit

Martin Pool mbp at canonical.com
Wed Nov 8 04:48:41 GMT 2006

On  7 Nov 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:
> Aaron Bentley wrote:
> > John Arbash Meinel wrote:
> >>> I'm not sure about auto resolving on commit. However, I think a 'bzr
> >>> resolve --check' would be a very good place for this.
> > 
> > Could you explain why that's an improvement?  From my POV, we shouldn't
> > ask the user to tell us what we already know.  What's the advantage of
> > the resolve step?
> My gut feeling is that 'commit' time isn't the right time for mutating
> the tree.  Especially because of:
> $ bzr status
> # This shows conflicts
> $ bzr commit -m 'forgot about conflicts'
> # This succeeds??
> Even worse is that doing a plain 'bzr commit' is going to show in the
> little summary that there are conflicts, and you are just supposed to
> ignore that because you know you resolved those problems.
> Further, it doesn't resolve all conflicts, so people might be used to
> having bzr infer the conflict status from the tree, and then when it
> can't they get confused.

Yes, that's why I was uncomfortable having it specially handled in
commit.  On the other hand as you just wrote, we don't want to block
people for a long time or let the perfect be the enemy of the good, so
if Aaron is sure doing it here is incrementally better it may be OK.

> It seems best to have the user specifically ask bzr to check for cleaned
> up conflicts. Now it may be that we should do this on any tree-analyzing
> command. So status/diff/info/etc all check to make sure conflicted files
> are really conflicted.

I don't think there should be a specific command; the point is to
eliminate a step.  How about instead:

  Commit fails if there are conflicts.

  The conflicts in a tree are taken from the tree's conflict list, 
  except that any text conflicts where the markers have been removed 
  are considered to be resolved.

This just requires WorkingTree.conflicts() to filter the list after it
reads it and everything else should just work(?)


More information about the bazaar mailing list