Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When cloning subrepo containing submodules, Git complains about missing .gitmodules #558

Closed
nyanpasu64 opened this issue Jan 28, 2022 · 1 comment

Comments

@nyanpasu64
Copy link

I have a project based around git-subrepo. When I added STX as a subrepo, it imported STX's submodules as-is (https://github.com/nyanpasu64/qvgmsplit/tree/073f8e0731f13a2a9ed36871acb4627ff532243d/3rdparty/STX/third_party) but didn't create a top-level .gitmodules file (but instead keeps "3rdparty/STX/.gitmodules").

Git doesn't know how to handle this state. Running git submodule produces errors:fatal: no submodule mapping found in .gitmodules for path '3rdparty/STX/third_party/abseil' or 3rdparty/STX/third_party/benchmark or 3rdparty/STX/third_party/googletest. The same thing happens when GitHub Actions's checkout action attempts to cleanup after a clone (actions/checkout#610). I think this would create issues for people performing a recursive clone as well.

Is it possible to alter git-subrepo to add an option to ignore submodules in the repo being cloned/pulled?

(Is git-subrepo dead?)

@admorgan
Copy link
Collaborator

This has been investigated a few times, but having a git subrepo that contains a git submodule isn't a scenario that we have been able to get working so far. The problem actually exists with git trees also.

The problem I see with the suggestion of filtering submodules out of subrepos is how do you communicate to the user that dependencies have changed on a pull or clone? I believe the documentation stating that subrepo does not support code that contains submodules is unlikely to change any time soon.

At the same time a PR that fixes this would be enthusiastically accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants