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

Re: git-submodule path computation bug with recursive submodules

From
Phil Hord <phil.hord@gmail.com>
Date
Jul 5, 2012, 14:18 UTC
Message-ID
<CABURp0qtbSsiRX9sJ1F5WS3wtKq32hpV=3pGmM6Ysn=9Nvw_nQ@mail.gmail.com>
In-Reply-To
<0B4C40CC-862E-4B15-9A4F-903DC8DBBAEC@play-bow.org>
On Thu, Jul 5, 2012 at 8:09 AM, Bob Halley <halley@play-bow.org> wrote:
Show 51 quoted lines
>
> The git-submodule command has problems in some cases when there is a symlink
> in the path returned by pwd.
>
> I've created a repository at http://www.play-bow.org/repos/product to
> demonstrate the issue.
>
> $ git --version
> git version 1.7.11.1.116.g8228a23
>
> I copied and built the head of the master branch today.
>
> First we need a symlink.  I discovered this problem because I had a symlink
> in / to a directory under my home directory for typing convenience.
>
> $ ls -al /bug
> lrwxr-xr-x  1 root  admin  17  5 Jul 12:26 /bug@ -> /Users/halley/bug
>
> $ cd /bug
> $ pwd
> /bug
>
> Note that pwd does not resolve the symlink (though pwd -P would on many
> platforms)
>
> $ pwd -P
> /Users/halley/bug/product
>
> $ git clone http://www.play-bow.org/repos/product
> Cloning into 'product'...
>
> I'm purposely not using 'clone --recursive' as the bug doesn't appear if you
> do that.
>
> $ cd product/
> $ ls
> file1   file2   foo/
>
> Let's get those submodules...
>
> $ git submodule update --init --recursive
> Submodule 'foo' (http://www.play-bow.org/repos/foo) registered for path 'foo'
> Cloning into 'foo'...
> Submodule path 'foo': checked out '2b02e1eb2e34961d807cfc5fc7e477e0ca844600'
> Submodule 'bar' (http://www.play-bow.org/repos/bar) registered for path 'bar'
> Cloning into 'bar'...
> fatal: Not a git repository: ../../../../Users/halley/bug/product/.git/modules/foo/modules/bar
> Failed to recurse into submodule path 'foo'
>
> The first level of submodule clones successfully, but submodule 'foo'
> contains submodule 'bar', and cloning it fails.
It fails for me too, running zsh and stock Linux.
Seems to originate here.
Commit: 69c3051780d6cacfe242563296160634dc667a90:
Author: Jens Lehmann <Jens.Lehmann@web.de>
Date:   Sun Mar 4 22:15:36 2012 +0100
    submodules: refactor computation of relative gitdir path
Phil
Previous: Bob HalleyNext: Jens Lehmann
Message 2 of 3 in “git-submodule path computation bug with recursive submodules”
  1. Bob HalleyJul 5, 2012
  2. Phil HordJul 5, 2012
  3. Jens LehmannJul 5, 2012

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.