remotes icon indicating copy to clipboard operation
remotes copied to clipboard

Submodules should be init and updated, not cloned

Open egonzalf opened this issue 6 years ago • 4 comments

Cloning submodules is not considereing the git commit of such repo. The current procedure parses the .gitmodules file, which it only references the url and optionally a branch and the clones using that info., thus getting the HEAD of such branch. The git submodule update --init --recursive should get the correct commit for each submodule.

egonzalf avatar Nov 22 '18 13:11 egonzalf

A fix to this issue could also resolve #236

egonzalf avatar Nov 26 '18 06:11 egonzalf

We can't simply use git submodule update --init --recursive, the zip archives from GitHub are not actually git repositories (they don't have a .git directory at all).

If the specific commit information is not stored in the .gitmodules file there is not really a way for us to retrieve it, although maybe there is something in the GitHub API we could potentially use...

jimhester avatar Nov 27 '18 15:11 jimhester

I guess you have your reasons on downloading instead of cloning, or maybe that is a behaviour of git2r. However, when using git='external' it will clone the repo. Maybe in such situation it could be cloned with submodules, or get the submodules on the next step.

egonzalf avatar Nov 28 '18 07:11 egonzalf

install_github() does not rely on any git client, external or git2r.

For install_git() we could potentially do this for the external git client.

jimhester avatar Nov 28 '18 14:11 jimhester