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

Re: [BUG] `git submodule update --init --recursive` stores gitdir in full path into `.git` of nested submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 30, 2016, 20:54 UTC
Message-ID
<xmqqpoubsn3b.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kZwSFjADYYC=FBFr8cWv08mv+H7E=Bx3N=J2Q_o8sK9qw@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 22 quoted lines
> On Wed, Mar 30, 2016 at 9:05 AM, Stefan Beller <sbeller@google.com> wrote:
>> On Wed, Mar 30, 2016 at 2:03 AM, Norio Nomura <norio.nomura@gmail.com> wrote:
>>> Hi,
>>>
>>> `git submodule update --init --recursive` stores `gitdir` in full path into `.git` of nested submodules.
>>> So, working directory is not portable to another directory.
>>
>> Are you reporting a regression bug? (Is that a new thing or has it
>> always been that way and you just discover that it is unfortunate?)
>> Which versions did you test with?
>
> ➜  15:34:32 git:(master) git --version
> git version 2.8.0
>
> at the end of your gist.
> The same happens when using 2.7.4, it doesn't happen when using 2.6.6 though.
>
> It turns out ee8838d (2015-09-08, submodule: rewrite `module_clone`
> shell function in C)
> broke it.
>
> I'll look into fixing it.
Thanks.

This may be an unrelated tangent, but somewhere in "submodule init" codepath seem to turn paths into absolute too aggressively. Merging your recent "path related fix" to 'pu' seems to break some test by showing absolute paths when the test expects to see relative ones.

Previous: Stefan Beller
Message 4 of 4 in “[BUG] `git submodule update --init --recursive` stores gitdir in full path into `.git` of nested submodules”
  1. Norio NomuraMar 30, 2016
  2. Stefan BellerMar 30, 2016
  3. Stefan BellerMar 30, 2016
  4. Junio C HamanoMar 30, 2016

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.