From: "Jesper Rønn-Jensen" <jesperrr@gmail.com>
To: git@vger.kernel.org
Subject: Error fetching submodule from submodule
Date: Thu, 7 Mar 2019 12:07:21 +0100 [thread overview]
Message-ID: <CAL-rKu6AcyHdrCsVikwQxTgKHgtV86+BeHOv_sTSu-jvwME75Q@mail.gmail.com> (raw)
Hi I think I may have found an error in the way git handles a
submodule's submodule. Read further for the example (extracted from a
real project).
* I have a main repository which has some submodules defined.
* One of the submodules is a common submodule which is also included
in one of the other submodules
* When running `git fetch --recurse-submodules` I get an error.
The error is "Could not access submodule 'common_submodule'"
```
$ git --version
git version 2.21.0
```
I created the following script to show (using Git-extras `git create`
to simplify):
```
#!/usr/bin/env bash
if [ "$FORCE" = 'true' ]; then
rm -rf submodule_experiment
fi
if [ -e submodule_experiment ]; then
echo FATAL: folder submodule_experiment must not exist. Remove with FORCE=true
exit 9
fi
mkdir submodule_experiment
pushd submodule_experiment
git setup common_submodule
pushd common_submodule
echo 'common file' > common.txt
git add common.txt
git commit -m 'a file in the common submodule'
popd
git setup other_submodule
pushd other_submodule
git submodule add ../common_submodule
git commit -m 'added submodule to other_submodule'
popd
git setup main_repos
pushd main_repos
git submodule add ../common_submodule
git commit -m 'added submodule to main_repos'
git submodule add ../other_submodule
git commit -m 'added other_submodule to main_repos'
# This line fails with error code 1 "Could not access submodule
'common_submodule'"
git fetch --recurse-submodules
```
Question:
Is this a bug in Git or am I declaring the common submodule in an incorrect way?
--
Jesper Rønn-Jensen
Nine A/S
Mobile: +45 2989 1822
Blog http://justaddwater.dk/
jesperrr@gmail.com (Private e-mail and Google Talk IM)
next reply other threads:[~2019-03-07 11:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-07 11:07 Jesper Rønn-Jensen [this message]
2019-03-07 18:08 ` Error fetching submodule from submodule Jeff King
2019-03-08 8:50 ` Jesper Rønn-Jensen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAL-rKu6AcyHdrCsVikwQxTgKHgtV86+BeHOv_sTSu-jvwME75Q@mail.gmail.com \
--to=jesperrr@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).