From: Heiko Voigt <hvoigt@hvoigt.net>
To: Robert Dailey <rcdailey.lists@gmail.com>
Cc: Git <git@vger.kernel.org>
Subject: Re: How are submodule conflicts resolved during rebase?
Date: Tue, 28 Apr 2015 18:49:04 +0200 [thread overview]
Message-ID: <20150428164904.GA4477@sandbox-ub1410> (raw)
In-Reply-To: <CAHd499CSshO-929PF7fiR4hpxd9J=S+XFuE3sdQHFjPvXT_C0w@mail.gmail.com>
On Tue, Apr 28, 2015 at 09:34:06AM -0500, Robert Dailey wrote:
> Suppose I have a branch with 10 commits on it, 3 of those commits
> contain a change to the same (and only) submodule in the repository.
> When I rebase this branch onto the tip of its parent branch, I get a
> conflict in each of the 3 commits because the submodule also changed
> on the parent branch since my last rebase.
>
> I've seen some cases where I am asked to resolve the submodule
> conflict with local or remote. I expect this behavior and it isn't
> confusing to me. However, I have also seen cases where rebase auto
> resolves the conflicted submodule.
>
> How does Git know to auto resolve some submodule conflicts but not the
> others? I find this behavior unpredictable and I haven't found any
> documentation on it (I'm giving the git docs the benefit of the doubt
> and assuming it's there, since the git docs are very very good).
There is some logic for submodule merges, but to prevent false merges
only the straight forward case results in a clean merge. In short:
Conflicts for submodules are auto resolved when one side is contained in
the other and both changes point forward.
I.e. when merging A and B in the superproject and the submodule looks
like this:
base---*---*---B
\ /
*---A---*---*
It will result in a clean merge in the superproject.
If there is a common commit that contains both sides but that commit is
not part of any side in the superproject the merge will fail but suggest
that commit as a conflict resolution.
Hope that helps.
Cheers Heiko
next prev parent reply other threads:[~2015-04-28 16:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 14:34 How are submodule conflicts resolved during rebase? Robert Dailey
2015-04-28 15:19 ` Robert Dailey
2015-04-28 16:49 ` Heiko Voigt [this message]
2015-04-28 18:19 ` Robert Dailey
2015-04-28 19:21 ` Heiko Voigt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150428164904.GA4477@sandbox-ub1410 \
--to=hvoigt@hvoigt.net \
--cc=git@vger.kernel.org \
--cc=rcdailey.lists@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).