Add git scalar clone feature to VSCode#286653
Add git scalar clone feature to VSCode#286653ShikeChen-MS wants to merge 6 commits intomicrosoft:mainfrom
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
|
Also, this is my first ever attempt to contribute to this project, apologize if I made any silly mistake here, really appreciate your time on review. Thanks a lot. |
There was a problem hiding this comment.
Pull request overview
This pull request adds support for cloning Git repositories using Scalar, a tool designed for faster cloning of large repositories. The implementation includes a new "Clone with Scalar" command that allows users to select scalar-specific options (--full-clone and --no-src) when cloning.
Key Changes:
- Added scalar executable detection and verification logic
- Implemented scalar clone execution alongside existing git clone
- Exposed scalar clone functionality through a new command and API
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/git/src/git.ts | Added scalar availability detection (isScalarAvailable, verifyScalarExecutable), scalar execution (execScalar), and integrated scalar clone into the main clone method |
| extensions/git/src/commands.ts | Added cloneWithScalar command that checks scalar availability, prompts for options, and delegates to clone manager |
| extensions/git/src/cloneManager.ts | Extended CloneOptions interface and cloneRepository method to support scalar options passthrough |
| extensions/git/src/api/git.d.ts | Added public API documentation for useScalar and scalarOptions in CloneOptions interface |
| extensions/git/src/api/api1.ts | Updated clone API implementation to pass scalar options through to clone manager |
| extensions/git/package.nls.json | Added localization string for "Clone with Scalar" command |
| extensions/git/package.json | Registered cloneWithScalar command with menu contributions in command palette and SCM repository context |
@microsoft-github-policy-service agree |
14368e4 to
01249bb
Compare
245e699 to
34b0086
Compare
dae5bdd to
05a1b67
Compare
f206ef0 to
629c3a1
Compare
91500bb to
b1ffdff
Compare
- Add new command 'git.cloneWithScalar' for cloning with Scalar - Add isScalarAvailable() method to check Scalar availability - Extend CloneOptions interface to support useScalar and scalarOptions - Add UI to select Scalar clone options (full-clone, no-src) - Update API to pass Scalar options through clone pipeline - Add localized strings for Scalar-related UI elements
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
b1ffdff to
013aeac
Compare
Hello Team:
I am proposing this pr for this feature request I sent out: #209285
To quickly get started on Scalar, please refer to this documentation: https://github.com/microsoft/git/blob/6107aca650556448b9719a3267f228f8e4e80aeb/contrib/scalar/docs/getting-started.md
The changes mainly added one item in command to specifically support clone with scalar with options to specify --full-clone and/or --no-src options.
To test:
Start test instance of VSCode, press Shift + Ctrl + P, type "clone", there will be a new option called "Clone with Scalar" as following screenshot shows:


Select it and it will be followed by selectable options (no source, full clone) as following screenshot:
Click ok, the scalar clone process will start in background just like regular git clone
Also, after use Scalar to clone repo, unless use full-clone, one will need to use git sparse-checkout to manage directories and paths they want to checkout, so added command to support sparse-checkout capablity.
For sparse-checkout set command, to help user, instead of ask user to manually input directories name everytime, it will run git ls-tree -d to get top level directories where user can simply select. Also there's option user can select to choose to manually input the directories in case they want to manage directories beyond top level.