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

Re: git merge banch w/ different submodule revision

From
Elijah Newren <newren@gmail.com>
Date
Apr 27, 2018, 00:02 UTC
Message-ID
<CABPp-BG0zjcCuO1q7ek5LH0oh+nruKhB7etqb9ZhtbjSCqpMVg@mail.gmail.com>
In-Reply-To
<CA+P7+xrUwq0G2YySC3SLKqyihhPnFPCiQnQpoVVa89+=W9O9+w@mail.gmail.com>
On Thu, Apr 26, 2018 at 2:46 PM, Jacob Keller <jacob.keller@gmail.com> wrote:
Show 9 quoted lines
> On Thu, Apr 26, 2018 at 10:56 AM, Stefan Beller <sbeller@google.com> wrote:
>> We often treating a submodule as a file from the superproject, but not always.
>> And in case of a merge, git seems to be a bit smarter than treating it
>> as a textfile
>> with two different lines.
>
> Sure, but a submodule is checked out "at a commit", so if two branches
> of history are merged, and they conflict over which place the
> submodule is at.... shouldn't that produce a conflict??

By "which place a submodule is at", do you mean the commit it points to, or the path at which the submodule is found within the parent repository? Continuing on it sounds like you meant the former, but I was unsure if you were asking mutliple different questions here.

Show 5 quoted lines
> I mean, how is the merge algorithm supposed to know which is right?
> The patch you linked appears to be able to resolve it to the one which
> contains both commits.. but that may not actually be true since you
> can rewind submodules since they're *pointers* to commits, not commits
> themselves.

Only if both commits also contain the base; see lines 328 to 332 of that patch. So, if the submodules are rewound, that algorithm would leave them as conflicted.

Previous: Middelschulte, LeifNext: Elijah Newren
Message 12 of 16 in “git merge banch w/ different submodule revision”
  1. Middelschulte, LeifApr 26, 2018
  2. Stefan BellerApr 26, 2018
  3. Jacob KellerApr 26, 2018
  4. Stefan BellerApr 26, 2018
  5. Heiko VoigtApr 30, 2018
  6. Middelschulte, LeifMay 2, 2018
  7. Heiko VoigtMay 3, 2018
  8. Middelschulte, LeifMay 4, 2018
  9. Heiko VoigtMay 4, 2018
  10. Elijah NewrenMay 4, 2018
  11. Middelschulte, LeifMay 7, 2018
  12. Elijah NewrenApr 27, 2018
  13. Elijah NewrenApr 27, 2018
  14. Middelschulte, LeifApr 27, 2018
  15. Elijah NewrenApr 28, 2018
  16. Jacob KellerApr 28, 2018

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.