Open Trilarion opened 5 years ago
It's more difficult than thought.
git clone --mirror
creates the bare repository that we store, but that does not allow to git submodule --init
because of "git-submodule cannot be used without a working tree".
It's not even possible to get information about used submodules with a bare repository.
See also here: https://stackoverflow.com/questions/22484179/git-bare-repositories-and-submodules
.gitmodules is a file within the repository, you can't directly access it within a bare repo
It seems that the information about submodules is stored in the working tree, a bare repo cannot access that information.
We could go through the git repositories, create the working tree (at least temporary), do "submodule init", get the .gitmodules file out of it, parse it and then mirror the additional submodules. That way all the information is stored, even though one would still need to insert local URLs in the .gitmodule files if a completely local "submodule update" is desired.
It's less complicated than I thought. See Get submodule hash from bare repository.
With git show HEAD:.gitmodules
one can get the list of submodules from a bare repository. We cannot do a recursive bare clone, but we can get the submodules list and mirror them as well.
I had some problems with repository URL resolutions. There are relative paths and also git@domain: notations or something just a ".". Otherwise it works now.
Will leave open until the name resolution works better.
Btw. it was definitely worth it. The approx. 1200 Git repos have ~550 unique, different submodules.
There were quite a few errors, my name resolution might not work well.
For example with endgame singularity (and others)