git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Merging submodules - best merge-base
@ 2013-02-25 16:44 Daniel Bratell
  2013-03-06 18:12 ` Heiko Voigt
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Bratell @ 2013-02-25 16:44 UTC (permalink / raw)
  To: git

I can phrase this in two ways and I'll start with the short way:

Why does a merge of a git submodule use as merge-base the commit that was  
active in the merge-base of the parent repo, rather than the merge-base of  
the two commits that are being merged?

The long question is:

A submodule change can be merged, but only if the merge is a  
"fast-forward" which I think is a fair demand, but currently it checks if  
it's a fast-forward from a commit that might not be very interesting  
anymore.

If two branches A and B split at a point when they used submodule commit  
S1 (based on S), and both then switched to S2 (also based on S) and B then  
switched to S21, then it's today not possible to merge B into A, despite  
S21 being a descendant of S2 and you get a conflict and this warning:

warning: Failed to merge submodule S (commits don't follow merge-base)

(attempt at ASCII gfx:

Submodule tree:

S ---- S1
   \
    \ - S2 -- S21

Main tree:

A' (uses S1) --- A (uses S2)
   \
    \ --- B' (uses S2) -- B (uses S21)


I would like it to end up as:

A' (uses S1) --- A (uses S2) ------------ A+ (uses S21)
   \                                     /
    \ --- B' (uses S2) -- B (uses S21)- /

And that should be legal since S21 is a descendant of S2.

/Daniel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-11 20:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-25 16:44 Merging submodules - best merge-base Daniel Bratell
2013-03-06 18:12 ` Heiko Voigt
2013-03-07  9:49   ` Daniel Bratell
2013-03-07 18:59     ` Heiko Voigt
2013-03-09 17:45       ` Jens Lehmann
2013-03-10 17:09         ` Heiko Voigt
2013-03-11 20:30           ` [RFC/PATCH] submodule: allow common rewind when merging submodules 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).