Subject: Re: [PATCH] submodule merge: update conflict error message

From: Junio C Hamano <[email-masked]>
Date: Wed, 08 Jun 2022 12:13:38 -0700

Calvin Wan <[email-masked]> writes:

>> The user probably
>> wants to merge the submodules, but they can choose however they want to
>> resolve the merge conflict
>
> It sounds like I should reword "merge conflicted submodules" to
> "resolve conflicted submodules". That should cover those 10% cases.
>
> I would prefer to find a generic, but still helpful message that doesn't
> require going into the advice() API or require some config change

We want the users not to blow away the half-merged state in the
working tree.  We are guiding them to first go into submodules and
merge (in which case, we should tell them merge what with what---I
think the first parent should be what they have checked out there,
but the other parent, which is what is recorded in the tree of the
superproject commit being merged as gitlink, may not be at the tip
of any branch you have in the submodule).  And then they come back
to the superproject and resolve the conflict in the working tree and
the index.

> > Failed to merge submodule <submodule>
> > CONFLICT (submodule): Merge conflict in <submodule>
> > Automatic merge failed; recursive merging with submodules is currently
> > not supported. To manually merge, merge conflicted submodules first
> > before merging the superproject.

So,

    to manually complete the merge:
    - go to submodule A, and merge commit a24c4e37d0
    - go to submodule B, and merge commit a6f14c960b
    - come back to superproject, and "git add A B" to record the above merge
    - in superproject, resolve the other conflicts
    - commit the resulting index in the superproject

or something along that line, perhaps?