vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Clone Repo in Container Volume: Generic clone command

Open gparmeggiani opened this issue 5 years ago • 4 comments

The current implementation of the "Clone Repo in Container Volume" takes away from the user the freedom to perform the git clone in the way he/she wants.

  • For what I can tell, it is not possible to do a --recursive clone
  • No way to clone a single branch with --single-branch etc...

I think that a new "advanced" clone option should be added. What I have in mind is that when prompted for the git URL, you have the option to provide either a URL or a git clone command, that you can fully customize.

gparmeggiani avatar Apr 16 '21 10:04 gparmeggiani

Any update on this?

gparmeggiani avatar Sep 16 '21 15:09 gparmeggiani

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 10 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

vscodenpa avatar Dec 12 '22 08:12 vscodenpa

This feature request has not yet received the 10 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding

vscodenpa avatar Feb 01 '23 02:02 vscodenpa

This seems related to https://github.com/microsoft/vscode-remote-release/issues/8258#issue-1639081557, which is how ended up finding this issue.

FWIW, in regards to the recursive clone bug described in the above link, I've managed to work around it with the following addition to .devcontainer.json:

	// workaround for issue where devcontainer build will fail if this was cloned non-recursively,
	// which is precisely the behavior when opening as a fresh devcontainer from a web link
	"initializeCommand": "if [ -z \"$(git -c safe.directory=${localWorkspaceFolder} status --porcelain)\" ]; then git -c safe.directory=${localWorkspaceFolder} submodule update --init --recursive; fi",

This does a recursive submodule update/init before creating the container, which resolves my issue.

The intention of the if [ -z ... ] conditional is to not reinitialize any subdirectories which may have been modified. I'll admit that I haven't fully verified that portion of it yet though...

Hope this helps someone!

rgalonso avatar Aug 15 '24 11:08 rgalonso

Unfortunately, the workaround does not work for me as the .devcontainer folder and contents are all from a git submodule. Would like the ability to customize the clone command used by the "Clone in..." features.

cruikshj avatar Sep 10 '24 16:09 cruikshj