Nested submodules and transitioning to repo

516 views
Skip to first unread message

Kobi Gurkan

unread,
Sep 18, 2017, 7:15:28 AM9/18/17
to Repo and Gerrit Discussion
Hi,

Let's say I have 3 repositories - A, B, C.
B is a submodule of A and C is a submodule of B. That means that when I run "git submodule update --init --recursive", I received the following directory structure: "A/B/C".
Modeling that in repo's default.xml is easy - just put multiple projects and adjust the paths accordingly.

What I'm wondering about is the situation where I have another repository D which needs B as well (and that means it also needs C as a submodule of B).
Currently, I am duplicating the definitions in repo for D.

So it looks kind of like this:
  <project name="A" remote="origin" path="A"/>
  <project name="B" remote="origin" revision="master" path="A/B"/>
  <project name="C" remote="origin" revision="master" path="A/B/C"/>

  <project name="D" remote="origin" path="D"/>
  <project name="B" remote="origin" revision="master" path="D/B"/>
  <project name="C" remote="origin" revision="master" path="D/B/C"/>

Can I somehow abstract the structure of B and re-use in the different repositories?

Alex Marcon

unread,
Nov 10, 2017, 2:55:17 AM11/10/17
to Repo and Gerrit Discussion
Hi Kobi, Im implementing repo within our git repository... and I'm trying to fetch the submodules within...
I'm already set sync-s "true" inside the manifest, and tried to repo sync with --fetch-submodules but nothing... the only way I got it to really fetch the submodules is with:

~/bin/repo forall <repoName> -c "git submodule update --init --recursive"

Do you know if that's the only way?

Thanks in advance,
Alex
Reply all
Reply to author
Forward
0 new messages