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

Re: Unable to checkout branch that has a new submodule with submodule.recurse

From
MFMike Fink <mike.fink@gmx.de>
Date
Oct 31, 2024, 08:30 UTC
Message-ID
<17601d47-5d44-4516-b4a0-052a0023d537@gmx.de>
In-Reply-To
<0218f6c7486cb6747a61db4a9d4990eab11f313f.camel@gmx.net>

Hi, comments see inline. KR, Mike.

On 20.09.24 12:24, Dennis Lubert wrote:
Show 13 quoted lines
> Hello World,
>
> for years now this has been bothering me. From time to time there is a
> new submodule in a branch and when checking that one out with my
> standard setup I get something like:
>
>> git checkout branchname
>
> fatal: not a git repository: ../.git/modules/submodule_new
> fatal: could not reset submodule index
>
> (this happens on all versions up to 2.46.1 and OS and whatnot I have
> access to)

I do experience the same problem with the current git for windows version. $ git --version git version 2.47.0.windows.2

Show 22 quoted lines
>
> While the workaround is clear (either clone with the desired branch
> right away or dont use --recurse-submodules and do update --init
> yourself), this is quite unfortunate for people in teams that work
> mostly with git integration or gui, also because when this happens it
> leaves the repo in an annoying state that needs  a bit more manual
> cleanup than --reset hard sometimes and especially for people that just
> use the basics this can be overwhelming.
>
> It seems that there is something wrong going on with the order of
> creation of the .git file and .git/modules/submodule/config entries,
> but I am not deep enough in the details to comment more on that.
>
> To help reproduce the problem reliably (hopefully) I have attached a
> shell script. You can run it in an empty directory (please review it
> before you do, I hacked it together, it might delete the wrong thing
> accidentally). It will need local ssh access (though I think modifying
> it to use local repos as submodules could be the same).
>
> greets
>
> Dennis
Previous: Dennis Lubert
Message 2 of 2 in “Unable to checkout branch that has a new submodule with submodule.recurse”
  1. Dennis LubertSep 20, 2024
  2. Mike FinkOct 31, 2024

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.