github / VisualStudio

GitHub Extension for Visual Studio
https://visualstudio.github.com
MIT License
2.38k stars 1.2k forks source link

Can't easily clone GitHub/VisualStudio from Team Explorer #925

Open jcansdale opened 7 years ago

jcansdale commented 7 years ago

What most people will likely try

  1. Go to 'Local Git Repositories' and Clone https://github.com/github/VisualStudio.git.
  2. Visual Studio stalls with the following: image
  3. Press Cancel and Visual Studio hangs: image
  4. Reboot Visual Studio. 😭

Mountain of success

  1. Go to 'Local Git Repositories', select Clone and paste: https://github.com/github/VisualStudio.git
  2. Uncheck 'Recursively Clone Submodules'. image
  3. Right click on VisualStudio folder in 'Solution Explorer' and 'Open Developer Command Prompt'.
    git submodule init
    git submodule deinit script
    git submodule update
  4. Return to Visual Studio and double-click on GitHubVS.sln.

At the moment a simple clone only works if:

  1. You're using GitHub Desktop
  2. You have permissions for the script submodule

Resolution

Could we make it so that rather than having to deinit the script submodule, we add the script submodule when doing CI or local signed builds? There could be a script to do this so it wouldn't be too onerous.

shana commented 7 years ago

A submodule cannot, by definition, be added without the parent repository tracking it - that's literally how submodules work.

The problem is that VS doesn't support ssh git urls and offers no skipping capabilities when it doesn't have credentials for a particular submodule - if VS handled skipping properly, this situation would at least be salvageable (probably want to report that to MS). What we can do is change to an https url instead of an ssh url so that VS can handle it properly, if it has the credentials for it.

jcansdale commented 7 years ago

A submodule cannot, by definition, be added without the parent repository tracking it - that's literally how submodules work.

Rather than adding it as a submodule (which I agree doesn't make sense), could we bootstrap the script repo in some other way? E.g. have a build script that first clones the script repo before executing the script that is used by CI.

What we can do is change to an https url instead of an ssh url so that VS can handle it properly, if it has the credentials for it.

It would be interesting to see how Visual Studio deals with this. With any luck we'd end up with all the public submodules and a warning that the private one hasn't been downloaded. This would be simpler than having to bootstrap anything.

meaghanlewis commented 6 years ago

@jcansdale do you still think is something that should be handled better?