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

Re: [BUG?] Issue with merging from another branch after replacing subdirectory with submodule

From
BNBen Nason <bnason@netflix.com>
Date
Apr 7, 2017, 15:25 UTC
Message-ID
<CAA-fqg1DGUmdXEAnYfEuK2Wts2wLfEr2hhharAghbCexL1+yAw@mail.gmail.com>
In-Reply-To
<CAGZ79kaGQHvGv-ZpfppbATucrJWVdS8Lq33CKs5AbV7qDGE3BA@mail.gmail.com>
Hi Stefan,

Thanks for the reply. Is there any known workaround for this situation, so that a manual resolve isn't needed for every single merge in this scenario?

Thanks, Benbuck

On Thu, Apr 6, 2017 at 4:05 PM, Stefan Beller <sbeller@google.com> wrote:
Show 24 quoted lines
> On Wed, Apr 5, 2017 at 11:10 PM, Ben Nason <bnason@netflix.com> wrote:
>> Hi,
>>
>> In git if you replace a subdirectory with a submodule in one branch,
>> every successive merge from another branch without that change will
>> cause a conflict. To reproduce this please see below (DOS batch file).
>>
>> Is this expected behavior?
>
> Yes.
>
> "git submodule update [--init]" only (creates or) updates existing
> submodules. It doesn't take care of removing submodules that are
> no longer recorded in the tree.
>
> "git merge" currently also does not touch submodules. (we may have
> git merge --recurse-submodules soon, though). So as soon as there
> is a conflict between the submodule (or an unrelated repo, who happens
> to live inside this other repo), and new directories/files that would appear,
> the merge errors out.
>
> Ideally Git would be smarter than the current behavior.
>
> Stefan
Previous: Stefan Beller
Message 3 of 3 in “[BUG?] Issue with merging from another branch after replacing subdirectory with submodule”
  1. Ben NasonApr 6, 2017
  2. Stefan BellerApr 6, 2017
  3. Ben NasonApr 7, 2017

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.