git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] submodule merge support

From
Johannes Sixt <j.sixt@eudaptics.com>
Date
May 7, 2007, 10:30 UTC
Message-ID
<463EFFC6.12A1B0A1@eudaptics.com>
In-Reply-To
<20070507090346.GI30511@admingilde.org>
Martin Waitz wrote:
Show 16 quoted lines
> On Sun, May 06, 2007 at 03:18:53PM -0700, Linus Torvalds wrote:
> > On Mon, 7 May 2007, Alex Riesen wrote:
> > > How about making all existing strategies just ignore submodules, and
> > > move recursive merge in the merge driver (git-merge.sh)?
> >
> > Yes, I think that's the right thing to do.
> >
> > I think it's the right thing for another reason: in a true "recursive"
> > merge, the submodules shouldn't be recursively merged anyway. *THEIR*
> > merge will have its own history, and doing it based on some random history
> > of the superproject is actually wrong anyway!
> 
> Of course the submodule has to get its own history, it's not possible
> to do otherwise.  But you have to trigger the submodule merge when you
> find a submodule-level conflict in the supermodule merge, just as
> you trigger file-level three-way merges, too.

I think you missed Linus's point: If the supermodule's merge leads to a conflict in the submodule links, it is not appropriate to merge the submodule.

Say you are merging commits A and B in the supermodule, and A uses v1.0 of the submodule and B uses v2.0 of submodule, then you can't just merge v1.0 and v2.0 - instead, you have to make a decision whether the supermodule's merge result is going to use v1.0 or v2.0 or even something different like v2.1. An automatic merge cannot make this decision for you (unless there was no conflict in the first place).

-- Hannes
Previous: Martin WaitzNext: Linus Torvalds
Message 6 of 10 in “submodule merge support”
  1. submodule merge supportMartin Waitz, May 6, 2007
  2. Alex RiesenMay 6, 2007
  3. Martin WaitzMay 6, 2007
  4. Linus TorvaldsMay 6, 2007
  5. Martin WaitzMay 7, 2007
  6. Johannes SixtMay 7, 2007
  7. Linus TorvaldsMay 7, 2007
  8. Martin WaitzMay 7, 2007
  9. Martin WaitzMay 7, 2007
  10. Martin WaitzMay 7, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.