Merge from vscode cfbd1999769f4f08dce29629fb92fdc0fac53829

This commit is contained in:
ADS Merger
2020-08-06 07:08:52 +00:00
parent 9c67832880
commit 540046ba00
362 changed files with 7588 additions and 6584 deletions

View File

@@ -753,149 +753,49 @@
"group": "navigation",
"when": "scmProvider == git"
},
{
"command": "git.sync",
"group": "1_sync",
"when": "scmProvider == git"
},
{
"command": "git.syncRebase",
"group": "1_sync",
"when": "scmProvider == git && gitState == idle"
},
{
"command": "git.pull",
"group": "1_sync",
"when": "scmProvider == git"
},
{
"command": "git.pullRebase",
"group": "1_sync",
"when": "scmProvider == git"
},
{
"command": "git.pullFrom",
"group": "1_sync",
"when": "scmProvider == git"
},
{
"command": "git.push",
"group": "1_sync",
"when": "scmProvider == git"
},
{
"command": "git.pushForce",
"group": "1_sync",
"when": "scmProvider == git && config.git.allowForcePush"
},
{
"command": "git.pushTo",
"group": "1_sync",
"when": "scmProvider == git"
},
{
"command": "git.pushToForce",
"group": "1_sync",
"when": "scmProvider == git && config.git.allowForcePush"
},
{
"command": "git.checkout",
"group": "2_branch",
"group": "1_header",
"when": "scmProvider == git"
},
{
"command": "git.publish",
"group": "2_branch",
"command": "git.clone",
"group": "1_header",
"when": "scmProvider == git"
},
{
"command": "git.commitStaged",
"group": "4_commit",
"submenu": "git.commit",
"group": "2_main@1",
"when": "scmProvider == git"
},
{
"command": "git.commitStagedSigned",
"group": "4_commit",
"submenu": "git.changes",
"group": "2_main@2",
"when": "scmProvider == git"
},
{
"command": "git.commitStagedAmend",
"group": "4_commit",
"submenu": "git.pullpush",
"group": "2_main@3",
"when": "scmProvider == git"
},
{
"command": "git.commitAll",
"group": "4_commit",
"submenu": "git.branch",
"group": "2_main@4",
"when": "scmProvider == git"
},
{
"command": "git.commitAllSigned",
"group": "4_commit",
"submenu": "git.remotes",
"group": "2_main@5",
"when": "scmProvider == git"
},
{
"command": "git.commitAllAmend",
"group": "4_commit",
"when": "scmProvider == git"
},
{
"command": "git.undoCommit",
"group": "4_commit",
"when": "scmProvider == git"
},
{
"command": "git.stageAll",
"group": "5_stage",
"when": "scmProvider == git"
},
{
"command": "git.unstageAll",
"group": "5_stage",
"when": "scmProvider == git"
},
{
"command": "git.cleanAll",
"group": "5_stage",
"when": "scmProvider == git"
},
{
"command": "git.stashIncludeUntracked",
"group": "6_stash",
"when": "scmProvider == git"
},
{
"command": "git.stash",
"group": "6_stash",
"when": "scmProvider == git"
},
{
"command": "git.stashPop",
"group": "6_stash",
"when": "scmProvider == git"
},
{
"command": "git.stashPopLatest",
"group": "6_stash",
"when": "scmProvider == git"
},
{
"command": "git.stashApply",
"group": "6_stash",
"when": "scmProvider == git"
},
{
"command": "git.stashApplyLatest",
"group": "6_stash",
"when": "scmProvider == git"
},
{
"command": "git.stashDrop",
"group": "6_stash",
"submenu": "git.stash",
"group": "2_main@6",
"when": "scmProvider == git"
},
{
"command": "git.showOutput",
"group": "7_repository",
"group": "3_footer",
"when": "scmProvider == git"
}
],
@@ -1307,8 +1207,184 @@
"group": "5_copy@2",
"when": "config.git.enabled && !git.missing && timelineItem =~ /git:file:commit\\b/"
}
],
"git.commit": [
{
"command": "git.commit",
"group": "1_commit@1"
},
{
"command": "git.commitStaged",
"group": "1_commit@2"
},
{
"command": "git.commitAll",
"group": "1_commit@3"
},
{
"command": "git.undoCommit",
"group": "1_commit@4"
},
{
"command": "git.rebaseAbort",
"group": "1_commit@5"
},
{
"command": "git.commitStagedAmend",
"group": "2_amend@1"
},
{
"command": "git.commitAllAmend",
"group": "2_amend@1"
},
{
"command": "git.commitStagedSigned",
"group": "3_signoff@1"
},
{
"command": "git.commitAllSigned",
"group": "3_signoff@2"
}
],
"git.changes": [
{
"command": "git.stageAll"
},
{
"command": "git.unstageAll"
},
{
"command": "git.cleanAll"
}
],
"git.pullpush": [
{
"command": "git.sync",
"group": "1_sync"
},
{
"command": "git.syncRebase",
"when": "gitState == idle",
"group": "1_sync"
},
{
"command": "git.pull",
"group": "2_pull"
},
{
"command": "git.pullRebase",
"group": "2_pull"
},
{
"command": "git.pullFrom",
"group": "2_pull"
},
{
"command": "git.push",
"group": "3_push"
},
{
"command": "git.pushForce",
"when": "config.git.allowForcePush",
"group": "3_push"
},
{
"command": "git.pushTo",
"group": "3_push"
},
{
"command": "git.pushToForce",
"when": "config.git.allowForcePush",
"group": "3_push"
},
{
"command": "git.fetch",
"group": "4_fetch"
},
{
"command": "git.fetchPrune",
"group": "4_fetch"
},
{
"command": "git.fetchAll",
"group": "4_fetch"
}
],
"git.branch": [
{
"command": "git.merge"
},
{
"command": "git.branch"
},
{
"command": "git.branchFrom"
},
{
"command": "git.renameBranch"
},
{
"command": "git.publish"
}
],
"git.remotes": [
{
"command": "git.addRemote"
},
{
"command": "git.removeRemote"
}
],
"git.stash": [
{
"command": "git.stash"
},
{
"command": "git.stashIncludeUntracked"
},
{
"command": "git.stashApplyLatest"
},
{
"command": "git.stashApply"
},
{
"command": "git.stashPopLatest"
},
{
"command": "git.stashPop"
},
{
"command": "git.stashDrop"
}
]
},
"submenus": [
{
"id": "git.commit",
"label": "%submenu.commit%"
},
{
"id": "git.changes",
"label": "%submenu.changes%"
},
{
"id": "git.pullpush",
"label": "%submenu.pullpush%"
},
{
"id": "git.branch",
"label": "%submenu.branch%"
},
{
"id": "git.remotes",
"label": "%submenu.remotes%"
},
{
"id": "git.stash",
"label": "%submenu.stash%"
}
],
"configuration": {
"title": "Git",
"properties": {
@@ -1425,6 +1501,11 @@
"description": "%config.ignoreMissingGitWarning%",
"default": false
},
"git.ignoreWindowsGit27Warning": {
"type": "boolean",
"description": "%config.ignoreWindowsGit27Warning%",
"default": false
},
"git.ignoreLimitWarning": {
"type": "boolean",
"description": "%config.ignoreLimitWarning%",

View File

@@ -99,6 +99,7 @@
"config.branchWhitespaceChar": "The character to replace whitespace in new branch names.",
"config.ignoreLegacyWarning": "Ignores the legacy Git warning.",
"config.ignoreMissingGitWarning": "Ignores the warning when Git is missing.",
"config.ignoreWindowsGit27Warning": "Ignores the warning when Git 2.25 - 2.26 is installed on Windows.",
"config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository.",
"config.defaultCloneDirectory": "The default location to clone a git repository.",
"config.enableSmartCommit": "Commit all changes when there are no staged changes.",
@@ -147,6 +148,14 @@
"config.untrackedChanges.hidden": "Untracked changes are hidden and excluded from several actions.",
"config.showCommitInput": "Controls whether to show the commit input in the Git source control panel.",
"config.terminalAuthentication": "Controls whether to enable VS Code to be the authentication handler for git processes spawned in the integrated terminal. Note: terminals need to be restarted to pick up a change in this setting.",
"submenu.commit": "Commit",
"submenu.commit.amend": "Amend",
"submenu.commit.signoff": "Sign Off",
"submenu.changes": "Changes",
"submenu.pullpush": "Pull, Push",
"submenu.branch": "Branch",
"submenu.remotes": "Remote",
"submenu.stash": "Stash",
"colors.added": "Color for added resources.",
"colors.modified": "Color for modified resources.",
"colors.deleted": "Color for deleted resources.",

View File

@@ -543,11 +543,11 @@ export class CommandCenter {
const uri = Uri.file(repositoryPath);
if (openFolder) {
commands.executeCommand('vscode.openFolder', uri);
commands.executeCommand('vscode.openFolder', uri, { forceReuseWindow: true });
} else if (result === addToWorkspace) {
workspace.updateWorkspaceFolders(workspace.workspaceFolders!.length, 0, { uri });
} else if (result === openNewWindow) {
commands.executeCommand('vscode.openFolder', uri, true);
commands.executeCommand('vscode.openFolder', uri, { forceNewWindow: true });
}
} catch (err) {
if (/already exists and is not an empty directory/.test(err && err.stderr || '')) {

View File

@@ -209,14 +209,25 @@ async function checkGitWindows(info: IGit): Promise<void> {
return;
}
const config = workspace.getConfiguration('git');
const shouldIgnore = config.get<boolean>('ignoreWindowsGit27Warning') === true;
if (shouldIgnore) {
return;
}
const update = localize('updateGit', "Update Git");
const neverShowAgain = localize('neverShowAgain', "Don't Show Again");
const choice = await window.showWarningMessage(
localize('git2526', "There are known issues with the installed Git {0}. Please update to Git >= 2.27 for the git features to work correctly.", info.version),
update
update,
neverShowAgain
);
if (choice === update) {
commands.executeCommand('vscode.open', Uri.parse('https://git-scm.com/'));
} else if (choice === neverShowAgain) {
await config.update('ignoreWindowsGit27Warning', true, true);
}
}

View File

@@ -61,6 +61,15 @@ class SyncStatusBar {
}
constructor(private repository: Repository, private remoteSourceProviderRegistry: IRemoteSourceProviderRegistry) {
this._state = {
enabled: true,
isSyncRunning: false,
hasRemotes: false,
HEAD: undefined,
remoteSourceProviders: this.remoteSourceProviderRegistry.getRemoteProviders()
.filter(p => !!p.publishRepository)
};
repository.onDidRunGitStatus(this.onDidRunGitStatus, this, this.disposables);
repository.onDidChangeOperations(this.onDidChangeOperations, this, this.disposables);
@@ -70,15 +79,6 @@ class SyncStatusBar {
const onEnablementChange = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.enableStatusBarSync'));
onEnablementChange(this.updateEnablement, this, this.disposables);
this.updateEnablement();
this._state = {
enabled: true,
isSyncRunning: false,
hasRemotes: false,
HEAD: undefined,
remoteSourceProviders: this.remoteSourceProviderRegistry.getRemoteProviders()
.filter(p => !!p.publishRepository)
};
}
private updateEnablement(): void {

View File

@@ -65,27 +65,32 @@ export class GitTimelineProvider implements TimelineProvider {
readonly id = 'git-history';
readonly label = localize('git.timeline.source', 'Git History');
private disposable: Disposable;
private readonly disposable: Disposable;
private providerDisposable: Disposable | undefined;
private repo: Repository | undefined;
private repoDisposable: Disposable | undefined;
private repoStatusDate: Date | undefined;
constructor(private readonly _model: Model) {
constructor(private readonly model: Model) {
this.disposable = Disposable.from(
_model.onDidOpenRepository(this.onRepositoriesChanged, this),
workspace.registerTimelineProvider(['file', 'git', 'vscode-remote', 'gitlens-git'], this),
model.onDidOpenRepository(this.onRepositoriesChanged, this),
);
if (model.repositories.length) {
this.ensureProviderRegistration();
}
}
dispose() {
this.providerDisposable?.dispose();
this.disposable.dispose();
}
async provideTimeline(uri: Uri, options: TimelineOptions, _token: CancellationToken): Promise<Timeline> {
// console.log(`GitTimelineProvider.provideTimeline: uri=${uri} state=${this._model.state}`);
const repo = this._model.getRepository(uri);
const repo = this.model.getRepository(uri);
if (!repo) {
this.repoDisposable?.dispose();
this.repoStatusDate = undefined;
@@ -110,7 +115,7 @@ export class GitTimelineProvider implements TimelineProvider {
let limit: number | undefined;
if (options.limit !== undefined && typeof options.limit !== 'number') {
try {
const result = await this._model.git.exec(repo.root, ['rev-list', '--count', `${options.limit.id}..`, '--', uri.fsPath]);
const result = await this.model.git.exec(repo.root, ['rev-list', '--count', `${options.limit.id}..`, '--', uri.fsPath]);
if (!result.exitCode) {
// Ask for 2 more (1 for the limit commit and 1 for the next commit) than so we can determine if there are more commits
limit = Number(result.stdout) + 2;
@@ -203,9 +208,17 @@ export class GitTimelineProvider implements TimelineProvider {
};
}
private ensureProviderRegistration() {
if (this.providerDisposable === undefined) {
this.providerDisposable = workspace.registerTimelineProvider(['file', 'git', 'vscode-remote', 'gitlens-git'], this);
}
}
private onRepositoriesChanged(_repo: Repository) {
// console.log(`GitTimelineProvider.onRepositoriesChanged`);
this.ensureProviderRegistration();
// TODO@eamodio: Being naive for now and just always refreshing each time there is a new repository
this.fireChanged();
}