From a9e136f1f466a8e5e53e9960a306f82acfd8b984 Mon Sep 17 00:00:00 2001 From: Harald Kirschner Date: Mon, 24 Jan 2022 09:36:55 -0800 Subject: [PATCH] New git welcome missing guide (#140293) New git welcome missing guide & shortening based on feedback --- extensions/git/package.json | 33 ++++++++++++++++++++++++++++++++- extensions/git/package.nls.json | 5 +++++ extensions/git/src/main.ts | 5 +++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/extensions/git/package.json b/extensions/git/package.json index f1657edfe3c..29f40d225ea 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -2218,6 +2218,17 @@ "default": 10000, "description": "%config.statusLimit%" }, + "git.experimental.installGuide": { + "type": "string", + "enum": [ + "default", + "download" + ], + "tags": ["experimental"], + "scope": "machine", + "description": "%config.experimental.installGuide%", + "default": "default" + }, "git.repositoryScanMaxDepth": { "type": "number", "scope": "resource", @@ -2335,10 +2346,30 @@ "contents": "%view.workbench.scm.disabled%", "when": "!config.git.enabled" }, + { + "view": "scm", + "contents": "%view.workbench.scm.missing.guide%", + "when": "config.git.enabled && git.missing && config.git.experimental.installGuide == download" + }, + { + "view": "scm", + "contents": "%view.workbench.scm.missing.guide.mac%", + "when": "config.git.enabled && git.missing && config.git.experimental.installGuide == download && isMac" + }, + { + "view": "scm", + "contents": "%view.workbench.scm.missing.guide.windows%", + "when": "config.git.enabled && git.missing && config.git.experimental.installGuide == download && isWindows" + }, + { + "view": "scm", + "contents": "%view.workbench.scm.missing.guide.windows%", + "when": "config.git.enabled && git.missing && config.git.experimental.installGuide == download && isLinux" + }, { "view": "scm", "contents": "%view.workbench.scm.missing%", - "when": "config.git.enabled && git.missing" + "when": "config.git.enabled && git.missing && config.git.experimental.installGuide == default" }, { "view": "scm", diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 7d94943f947..a8ee55951ec 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -194,6 +194,7 @@ "config.showUnpublishedCommitsButton.whenEmpty": "Only shows the action button if there are no other changes and there are unpublished commits.", "config.showUnpublishedCommitsButton.never": "Never shows the action button.", "config.statusLimit": "Controls how to limit the number of changes that can be parsed from Git status command. Can be set to 0 for no limit.", + "config.experimental.installGuide": "Experimental improvements for the git setup flow.", "config.repositoryScanMaxDepth": "Controls the depth used when scanning workspace folders for Git repositories when `#git.autoRepositoryDetection#` is set to `true` or `subFolders`. Can be set to `-1` for no limit.", "submenu.explorer": "Git", "submenu.commit": "Commit", @@ -216,6 +217,10 @@ "colors.conflict": "Color for resources with conflicts.", "colors.submodule": "Color for submodule resources.", "view.workbench.scm.missing": "A valid git installation was not detected, more details can be found in the [git output](command:git.showOutput).\nPlease [install git](https://git-scm.com/), or learn more about how to use git and source control in VS Code in [our docs](https://aka.ms/vscode-scm).\nIf you're using a different version control system, you can [search the Marketplace](command:workbench.extensions.search?%22%40category%3A%5C%22scm%20providers%5C%22%22) for additional extensions.", + "view.workbench.scm.missing.guide.windows": "[Download Git for Windows](https://git-scm.com/download/win)\nAfter installing, please [reload](command:workbench.action.reloadWindow) (or [troubleshoot](command:git.showOutput)). Additional source control providers can be installed [from the Marketplace](command:workbench.extensions.search?%22%40category%3A%5C%22scm%20providers%5C%22%22).", + "view.workbench.scm.missing.guide.mac": "[Download Git for macOS](https://git-scm.com/download/mac)\nAfter installing, please [reload](command:workbench.action.reloadWindow) (or [troubleshoot](command:git.showOutput)). Additional source control providers can be installed [from the Marketplace](command:workbench.extensions.search?%22%40category%3A%5C%22scm%20providers%5C%22%22).", + "view.workbench.scm.missing.guide.linux": "Source control depends on Git being installed.\n[Download Git for Linux](https://git-scm.com/download/mac)\nAfter installing, please [reload](command:workbench.action.reloadWindow) (or [troubleshoot](command:git.showOutput)). Additional source control providers can be installed [from the Marketplace](command:workbench.extensions.search?%22%40category%3A%5C%22scm%20providers%5C%22%22).", + "view.workbench.scm.missing.guide": "Install Git, a popular source control system, to track code changes and collaborate with others. Learn more in our [Git guides](https://aka.ms/vscode-scm).", "view.workbench.scm.disabled": "If you would like to use git features, please enable git in your [settings](command:workbench.action.openSettings?%5B%22git.enabled%22%5D).\nTo learn more about how to use git and source control in VS Code [read our docs](https://aka.ms/vscode-scm).", "view.workbench.scm.empty": "In order to use git features, you can open a folder containing a git repository or clone from a URL.\n[Open Folder](command:vscode.openFolder)\n[Clone Repository](command:git.clone)\nTo learn more about how to use git and source control in VS Code [read our docs](https://aka.ms/vscode-scm).", "view.workbench.scm.folder": "The folder currently open doesn't have a git repository. You can initialize a repository which will enable source control features powered by git.\n[Initialize Repository](command:git.init?%5Btrue%5D)\nTo learn more about how to use git and source control in VS Code [read our docs](https://aka.ms/vscode-scm).", diff --git a/extensions/git/src/main.ts b/extensions/git/src/main.ts index 5bf31064c73..f31a64d9c33 100644 --- a/extensions/git/src/main.ts +++ b/extensions/git/src/main.ts @@ -192,6 +192,11 @@ export async function _activate(context: ExtensionContext): Promise