* How are submodule conflicts resolved during rebase?
@ 2015-04-28 14:34 Robert Dailey
2015-04-28 15:19 ` Robert Dailey
2015-04-28 16:49 ` Heiko Voigt
0 siblings, 2 replies; 5+ messages in thread
From: Robert Dailey @ 2015-04-28 14:34 UTC (permalink / raw)
To: Git
Hey guys,
I'm using Git for Windows 2.3.6. There is a bit of confusion I have
with regards to how submodule conflicts are resolved/handled during a
rebase.
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).
Help is appreciated. Thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How are submodule conflicts resolved during rebase?
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
1 sibling, 0 replies; 5+ messages in thread
From: Robert Dailey @ 2015-04-28 15:19 UTC (permalink / raw)
To: Git
On Tue, Apr 28, 2015 at 9:34 AM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
> Hey guys,
>
> I'm using Git for Windows 2.3.6. There is a bit of confusion I have
> with regards to how submodule conflicts are resolved/handled during a
> rebase.
>
> 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).
>
> Help is appreciated. Thank you.
I also have rerere enabled in my global .gitconfig. Would this result
in the behavior above? Resolve first submodule conflict, rebase
--continue, then the next one is auto resolved?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How are submodule conflicts resolved during rebase?
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
2015-04-28 18:19 ` Robert Dailey
1 sibling, 1 reply; 5+ messages in thread
From: Heiko Voigt @ 2015-04-28 16:49 UTC (permalink / raw)
To: Robert Dailey; +Cc: Git
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How are submodule conflicts resolved during rebase?
2015-04-28 16:49 ` Heiko Voigt
@ 2015-04-28 18:19 ` Robert Dailey
2015-04-28 19:21 ` Heiko Voigt
0 siblings, 1 reply; 5+ messages in thread
From: Robert Dailey @ 2015-04-28 18:19 UTC (permalink / raw)
To: Heiko Voigt; +Cc: Git
On Tue, Apr 28, 2015 at 11:49 AM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
> 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
So if I understand this correctly, you are saying that during a rebase
if it sees a potential conflict for a submodule in the commit being
rebased, it will inspect the ancestry of the actual commits in the
submodule logs? For a rebase, does this mean that the local (latest
SHA1 from the submodule in the target branch of the rebase) submodule
commit must be reachable from the remote (SHA1 contained in the diff
of the commit currently being rebased) submodule commit?
I just want to make sure this is the logic. Thanks for explaining,
still trying to wrap my head around it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How are submodule conflicts resolved during rebase?
2015-04-28 18:19 ` Robert Dailey
@ 2015-04-28 19:21 ` Heiko Voigt
0 siblings, 0 replies; 5+ messages in thread
From: Heiko Voigt @ 2015-04-28 19:21 UTC (permalink / raw)
To: Robert Dailey; +Cc: Git
On Tue, Apr 28, 2015 at 01:19:00PM -0500, Robert Dailey wrote:
> On Tue, Apr 28, 2015 at 11:49 AM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
> > 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.
> >
> So if I understand this correctly, you are saying that during a rebase
> if it sees a potential conflict for a submodule in the commit being
> rebased, it will inspect the ancestry of the actual commits in the
> submodule logs?
Yes that is correct.
> For a rebase, does this mean that the local (latest SHA1 from the
> submodule in the target branch of the rebase) submodule commit must be
> reachable from the remote (SHA1 contained in the diff of the commit
> currently being rebased) submodule commit?
I does not matter which is reachable from which but yes one has to be
reachable from the other.
> I just want to make sure this is the logic. Thanks for explaining,
> still trying to wrap my head around it.
Yeah submodule things tend become complicated to think about at times.
Cheers Heiko
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-04-28 19:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2015-04-28 18:19 ` Robert Dailey
2015-04-28 19:21 ` Heiko Voigt
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).