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

Re: git-submodule path computation bug with recursive submodules

From
Jens Lehmann <jens.lehmann@web.de>
Date
Jul 5, 2012, 18:34 UTC
Message-ID
<4FF5DE30.6030100@web.de>
In-Reply-To
<CABURp0qtbSsiRX9sJ1F5WS3wtKq32hpV=3pGmM6Ysn=9Nvw_nQ@mail.gmail.com>
Am 05.07.2012 16:18, schrieb Phil Hord:
Show 13 quoted lines
> On Thu, Jul 5, 2012 at 8:09 AM, Bob Halley <halley@play-bow.org> wrote:
>> 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
Yup, thanks both for reporting and nailing that one down.

This diff fixes the problem for me and should be a portable way to avoid "pwd -P" or "cd -P", I'll cook up a patch with test for that:

diff --git a/git-submodule.sh b/git-submodule.sh
index 5c61ae2..4a22555 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -150,8 +150,8 @@ module_clone()
                die "$(eval_gettext "Clone of '\$url' into submodule path '\$sm_
        fi

-       a=$(cd "$gitdir" && pwd)/
-       b=$(cd "$sm_path" && pwd)/
+       a=$(cd_to_toplevel && cd "$gitdir" && pwd)/
+       b=$(cd_to_toplevel && cd "$sm_path" && pwd)/
        # normalize Windows-style absolute paths to POSIX-style absolute paths
        case $a in [a-zA-Z]:/*) a=/${a%%:*}${a#*:} ;; esac
        case $b in [a-zA-Z]:/*) b=/${b%%:*}${b#*:} ;; esac
Previous: Phil Hord
Message 3 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.