# bug: nested submodules get an absolute gitdir path

3 messages from 2016-04-06 to 2016-04-07. Participants: Antti Halttunen, Junio C Hamano.
Thread: https://gitlist.dev/t/41942

## Antti Halttunen, 2016-04-06 07:02

Subject: bug: nested submodules get an absolute gitdir path
Message-ID: <CALoo-5WcdMNMcCW0EQv1VqkE5Ax7bMnvo2r7niYhYyMjA8c4wg@mail.gmail.com>
URL: https://gitlist.dev/e/CALoo-5WcdMNMcCW0EQv1VqkE5Ax7bMnvo2r7niYhYyMjA8c4wg%40mail.gmail.com

```
Hi all,

Starting with git v2.7.0,

submodules two levels deep get a .git contents of:
 gitdir: /absolute/path/name

This breaks repos that are moved or copied:

fatal: Not a git repository:
/tmp/tmp.gIyxKWIC26/repo/.git/modules/sub/modules/sub
fatal: 'git status --porcelain' failed in submodule sub

The script https://gitlab.com/snippets/17301 reproduces the issue.

git bisect points to commit ee8838d1.

thanks,
-- 
antti

```

## Junio C Hamano, 2016-04-06 15:02

Subject: Re: bug: nested submodules get an absolute gitdir path
Message-ID: <xmqqmvp6zsos.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqmvp6zsos.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <CALoo-5WcdMNMcCW0EQv1VqkE5Ax7bMnvo2r7niYhYyMjA8c4wg@mail.gmail.com>

```
Antti Halttunen <Antti.Halttunen@iki.fi> writes:

> Starting with git v2.7.0,
>
> submodules two levels deep get a .git contents of:
>  gitdir: /absolute/path/name

I think that this is $gmane/290491

http://thread.gmane.org/gmane.comp.version-control.git/290491

and queued as sb/submodule-helper-clone-regression-fix topic,
currently included on the 'pu' branch.  Can you try it and see if it
fixes your issue?

Thanks.

>
> This breaks repos that are moved or copied:
>
> fatal: Not a git repository:
> /tmp/tmp.gIyxKWIC26/repo/.git/modules/sub/modules/sub
> fatal: 'git status --porcelain' failed in submodule sub
>
> The script https://gitlab.com/snippets/17301 reproduces the issue.
>
> git bisect points to commit ee8838d1.
>
> thanks,

```

## Antti Halttunen, 2016-04-07 06:44

Subject: Re: bug: nested submodules get an absolute gitdir path
Message-ID: <CALoo-5XQtLsiEneqLdJyi8Wa5pTX_Kz8f7C1H6ir2=J2ZLAyLg@mail.gmail.com>
URL: https://gitlist.dev/e/CALoo-5XQtLsiEneqLdJyi8Wa5pTX_Kz8f7C1H6ir2%3DJ2ZLAyLg%40mail.gmail.com
In-Reply-To: <xmqqmvp6zsos.fsf@gitster.mtv.corp.google.com>

```
On Wed, Apr 6, 2016 at 6:02 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Antti Halttunen <Antti.Halttunen@iki.fi> writes:
>
>> Starting with git v2.7.0,
>>
>> submodules two levels deep get a .git contents of:
>>  gitdir: /absolute/path/name
>
> I think that this is $gmane/290491
>
> http://thread.gmane.org/gmane.comp.version-control.git/290491
>
> and queued as sb/submodule-helper-clone-regression-fix topic,
> currently included on the 'pu' branch.  Can you try it and see if it
> fixes your issue?

it does, thanks.

> Thanks.
>
>>
>> This breaks repos that are moved or copied:
>>
>> fatal: Not a git repository:
>> /tmp/tmp.gIyxKWIC26/repo/.git/modules/sub/modules/sub
>> fatal: 'git status --porcelain' failed in submodule sub
>>
>> The script https://gitlab.com/snippets/17301 reproduces the issue.
>>
>> git bisect points to commit ee8838d1.
>>
>> thanks,

-- 
antti

```
