[PATCH] merge: give clearer error messages when there is nothing to merge

Greg Ward greg-hg at gerg.ca
Wed Jun 16 08:28:56 CDT 2010


On Tue, Jun 15, 2010 at 6:09 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Mon, 2010-06-14 at 14:45 -0400, Greg Ward wrote:
>> @@ -6,5 +6,6 @@
>>  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>>  (branch merge, don't forget to commit)
>>  bogus fast-forward should fail
>> -abort: can't merge with ancestor
>> +abort: nothing to merge
>> +(attempt to merge with an ancestor of the working dir)
>
> I'm not sold on this. I think the original message is more to the point.
> Also, we generally save "(some text)" for advice on how to deal with an
> issue.

OK, I'll just come right out and say it boldly: "can't merge with
ancestor" is *completely incomprehensible* to new users, and somewhat
confusing to experienced users.

The first time I saw it, I had no idea what it meant.  Same experience
with an intelligent co-worker: he has a degree in CS, knows what a DAG
is, and understands that "ancestor" is a key concept in Mercurial.
But the first time he saw "can't merge with ancestor", he had to come
ask me what the heck that means.  It was a simple user error; he
forgot to commit on branch i-1 before merging to branch i.  So the
real problem was that there was nothing to merge.  (In fact, that
question was what prompted me into this rabbit hole of improving
merge's error reporting.)

The original thread is:

  http://thread.gmane.org/gmane.comp.version-control.mercurial.devel/30149

There was some consensus that we can do better than "can't merge with
ancestor", but only slight agreement on what the better message should
be.  So I gave it my best shot.  I am of course open to better ideas,
but I remain convinced that we can and should do better than "can't
merge with ancestor".

Greg


More information about the Mercurial-devel mailing list