Why does recursive submodule update from github fail for DoctrineMongoORMModule?

doctrine-odm, git, zend-framework2

Solution

Ok, so I worked out the problem. Mingw32 has a path length limit, which is related to the windows path length limit (see msdn). Problem was overcome by shortening the gitdir path. Rather than using a relative path, I've changed it to an absolute path, witch elimaties `../../../../../../../../../../` from the gitdir string in exchange for `c:/xds/sds`. That shortening is just enought to make it all go.

Problem

Is this something I am doing wrong, or a wider bug? If I execute the following git commands in an empty directory: ``` git init git submodule add https://github.com/doctrine/DoctrineMongoODMModule \vendor\DoctrineMongoODMModule git submodule update --init --recursive ``` The all goes well, multiple submodules are pulled, and then it fails with the following output: ``` fatal: not a git repository: ../../../../../../../../../../.git/modules/vendor/DoctrineMongoODMModule/modules/vendor/mongodb-odm/modules/lib/vendor/doctrine-mongodb/modules/lib/vendor/doctrine-common Unable to find current revision in submodule pat 'lib/vendor/doctrine-common' ``` I've done a bit more digging. The .git file in the submodule that is causing the problem has the following contents: ``` gitdir: ../../../../../../../../../../.git/modules/vendor/DoctrineMongoODMModule/modules/vendor/mongodb-odm/modules/lib/vendor/doctrine-mongodb/modules/lib/vendor/doctrine-common ``` I have checked that gitdir path, and it does exist. However, I am using a Windows XP machine and if I attempt this from the cmd prompt I have problems: ``` C:\xds\sds\vendor\DoctrineMongoODMModule\vendor\mongodb-odm\lib\vendor\doctrine- mongodb\lib\vendor\doctrine-common>cd ../../../../../../../../../../.git/modules /vendor/DoctrineMongoODMModule/modules/vendor/mongodb-odm/modules/lib/vendor/doc trine-mongodb/modules/lib/vendor/doctrine-common The system cannot find the path specified. ``` It appears that the directory change string is too long, because if I split it into two parts it works: ``` C:\xds\sds\vendor\DoctrineMongoODMModule\vendor\mongodb-odm\lib\vendor\doctrine- mongodb\lib\vendor\doctrine-common>cd ../../../../../../../../../../.git/modules /vendor/DoctrineMongoODMModule/modules/vendor/mongodb-odm/modules/lib/vendor/doc trine-mongodb/ C:\xds\sds\.git\modules\vendor\DoctrineMongoODMModule\modules\vendor\mongodb-odm \modules\lib\vendor\doctrine-mongodb>cd modules/lib/vendor/doctrine-common C:\xds\sds\.git\modules\vendor\DoctrineMongoODMModule\modules\vendor\mongodb-odm \modules\lib\vendor\doctrine-mongodb\modules\lib\vendor\doctrine-common> ``` Any advice or help would be appreciated. Cheers.

Original source