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

git clone workaround #12

Merged
merged 2 commits into from
Jun 14, 2024
Merged

git clone workaround #12

merged 2 commits into from
Jun 14, 2024

Conversation

jeremyj563
Copy link

@jeremyj563 jeremyj563 commented Jun 11, 2024

Background

A few days ago there was a .gitmodules file added to the official nvm repository:

Unfortunately the URL used in that submodule is apparently not publicly accessible:

$ git clone git@github.com:nvm-sh/nvmrc.git /tmp/nvmrc

Cloning into '/tmp/nvmrc'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ gh repo clone git@github.com:nvm-sh/nvmrc.git /tmp/nvmrc

Cloning into '/tmp/nvmrc'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
failed to run git: exit status 128

The problem for us is that for some reason the default value of ansible.builtin.git.recursive is true (which means all submodules will also be cloned):

Solution

Therefore an obvious workaround is to simply set recursive to false - which is all this PR does...

To me it seems strange that the default behavior for the built-in git module is to do a recursive clone... though I highly doubt they would be willing to change that default value to false. Doing so would likely break git clone tasks for a large amount of people who depend on it implicitly.

We could also reach out to the nvm team to see if they could use a public repo URL for their submodule config...

Not sure what else we could do for a proper solution here.

@stephdewit stephdewit merged commit 9e3d379 into stephdewit:master Jun 14, 2024
@stephdewit
Copy link
Owner

Hello @jeremyj563

Thanks for the pull request.

A new release is available.

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

Successfully merging this pull request may close these issues.

2 participants