Skip to content

Add git scalar clone feature to VSCode#286653

Open
ShikeChen-MS wants to merge 6 commits intomicrosoft:mainfrom
ShikeChen-MS:user/shikechen/scalar-rebased
Open

Add git scalar clone feature to VSCode#286653
ShikeChen-MS wants to merge 6 commits intomicrosoft:mainfrom
ShikeChen-MS:user/shikechen/scalar-rebased

Conversation

@ShikeChen-MS
Copy link
Copy Markdown

@ShikeChen-MS ShikeChen-MS commented Jan 9, 2026

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:
scalar clone
Select it and it will be followed by selectable options (no source, full clone) as following screenshot:
scalar option
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.

Screenshot 2026-01-15 124637

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.

Copilot AI review requested due to automatic review settings January 9, 2026 01:56
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering bot commented Jan 9, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@lszomoru

Matched files:

  • extensions/git/package.json
  • extensions/git/package.nls.json
  • extensions/git/src/api/api1.ts
  • extensions/git/src/api/git.d.ts
  • extensions/git/src/cloneManager.ts
  • extensions/git/src/commands.ts
  • extensions/git/src/git.ts
  • extensions/git/src/repository.ts
  • extensions/git/src/test/git.test.ts
  • extensions/git/src/test/scalar.test.ts
  • extensions/git/src/test/sparse-checkout.test.ts

@ShikeChen-MS
Copy link
Copy Markdown
Author

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ShikeChen-MS
Copy link
Copy Markdown
Author

@ShikeChen-MS please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@ShikeChen-MS ShikeChen-MS force-pushed the user/shikechen/scalar-rebased branch from 14368e4 to 01249bb Compare January 9, 2026 19:36
@ShikeChen-MS ShikeChen-MS force-pushed the user/shikechen/scalar-rebased branch 8 times, most recently from 245e699 to 34b0086 Compare January 22, 2026 18:28
@ShikeChen-MS ShikeChen-MS force-pushed the user/shikechen/scalar-rebased branch 3 times, most recently from dae5bdd to 05a1b67 Compare January 29, 2026 04:24
@ShikeChen-MS ShikeChen-MS requested a review from Copilot January 29, 2026 04:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 9 comments.

@ShikeChen-MS ShikeChen-MS force-pushed the user/shikechen/scalar-rebased branch 4 times, most recently from f206ef0 to 629c3a1 Compare February 9, 2026 19:25
@ShikeChen-MS ShikeChen-MS force-pushed the user/shikechen/scalar-rebased branch 2 times, most recently from 91500bb to b1ffdff Compare February 12, 2026 22:51
- 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
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.

3 participants