Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/extensions/vscode-extras/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class Extension extends vscode.Disposable {
private readonly _output: vscode.LogOutputChannel;
private _npmFeature: NpmUpToDateFeature | undefined;

constructor(context: vscode.ExtensionContext) {
constructor(_context: vscode.ExtensionContext) {
const disposables: vscode.Disposable[] = [];
super(() => disposables.forEach(d => d.dispose()));

Expand Down
80 changes: 40 additions & 40 deletions build/azure-pipelines/product-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,46 +202,6 @@ extends:
jobs:
- template: build/azure-pipelines/product-quality-checks.yml@self

- ${{ if eq(variables['VSCODE_CIBUILD'], true) }}:
- stage: node_modules
dependsOn: []
jobs:
- template: build/azure-pipelines/win32/product-build-win32-node-modules.yml@self
parameters:
VSCODE_ARCH: arm64
- template: build/azure-pipelines/linux/product-build-linux-node-modules.yml@self
parameters:
NPM_ARCH: arm64
VSCODE_ARCH: arm64
- template: build/azure-pipelines/linux/product-build-linux-node-modules.yml@self
parameters:
NPM_ARCH: arm
VSCODE_ARCH: armhf
- template: build/azure-pipelines/alpine/product-build-alpine-node-modules.yml@self
parameters:
VSCODE_ARCH: x64
- template: build/azure-pipelines/alpine/product-build-alpine-node-modules.yml@self
parameters:
VSCODE_ARCH: arm64
- template: build/azure-pipelines/darwin/product-build-darwin-node-modules.yml@self
parameters:
VSCODE_ARCH: x64
- template: build/azure-pipelines/web/product-build-web-node-modules.yml@self

- ${{ if eq(variables['VSCODE_CIBUILD'], false) }}:
- stage: APIScan
dependsOn: []
pool:
name: 1es-windows-2022-x64
os: windows
jobs:
- job: WindowsAPIScan
steps:
- template: build/azure-pipelines/win32/sdl-scan-win32.yml@self
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}

- ${{ if eq(variables['VSCODE_BUILD_STAGE_WINDOWS'], true) }}:
- stage: Windows
dependsOn: []
Expand Down Expand Up @@ -778,3 +738,43 @@ extends:
- template: build/azure-pipelines/product-release.yml@self
parameters:
VSCODE_RELEASE: ${{ parameters.VSCODE_RELEASE }}

- ${{ if eq(variables['VSCODE_CIBUILD'], true) }}:
- stage: node_modules
dependsOn: []
jobs:
- template: build/azure-pipelines/win32/product-build-win32-node-modules.yml@self
parameters:
VSCODE_ARCH: arm64
- template: build/azure-pipelines/linux/product-build-linux-node-modules.yml@self
parameters:
NPM_ARCH: arm64
VSCODE_ARCH: arm64
- template: build/azure-pipelines/linux/product-build-linux-node-modules.yml@self
parameters:
NPM_ARCH: arm
VSCODE_ARCH: armhf
- template: build/azure-pipelines/alpine/product-build-alpine-node-modules.yml@self
parameters:
VSCODE_ARCH: x64
- template: build/azure-pipelines/alpine/product-build-alpine-node-modules.yml@self
parameters:
VSCODE_ARCH: arm64
- template: build/azure-pipelines/darwin/product-build-darwin-node-modules.yml@self
parameters:
VSCODE_ARCH: x64
- template: build/azure-pipelines/web/product-build-web-node-modules.yml@self

- ${{ if eq(variables['VSCODE_CIBUILD'], false) }}:
- stage: APIScan
dependsOn: []
pool:
name: 1es-windows-2022-x64
os: windows
jobs:
- job: WindowsAPIScan
steps:
- template: build/azure-pipelines/win32/sdl-scan-win32.yml@self
parameters:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }}
112 changes: 112 additions & 0 deletions extensions/git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,46 @@
"title": "%command.deleteRef%",
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.repositories.worktreeCopyBranchName",
"title": "%command.artifactCopyBranchName%",
"category": "Git"
},
{
"command": "git.repositories.worktreeCopyCommitHash",
"title": "%command.artifactCopyCommitHash%",
"category": "Git"
},
{
"command": "git.repositories.worktreeCopyPath",
"title": "%command.artifactCopyWorktreePath%",
"category": "Git"
},
{
"command": "git.repositories.copyCommitHash",
"title": "%command.artifactCopyCommitHash%",
"category": "Git"
},
{
"command": "git.repositories.copyBranchName",
"title": "%command.artifactCopyBranchName%",
"category": "Git"
},
{
"command": "git.repositories.copyTagName",
"title": "%command.artifactCopyTagName%",
"category": "Git"
},
{
"command": "git.repositories.copyStashName",
"title": "%command.artifactCopyStashName%",
"category": "Git"
},
{
"command": "git.repositories.stashCopyBranchName",
"title": "%command.artifactCopyBranchName%",
"category": "Git"
}
],
"continueEditSession": [
Expand Down Expand Up @@ -1846,6 +1886,38 @@
{
"command": "git.repositories.deleteWorktree",
"when": "false"
},
{
"command": "git.repositories.worktreeCopyBranchName",
"when": "false"
},
{
"command": "git.repositories.worktreeCopyCommitHash",
"when": "false"
},
{
"command": "git.repositories.worktreeCopyPath",
"when": "false"
},
{
"command": "git.repositories.copyCommitHash",
"when": "false"
},
{
"command": "git.repositories.copyBranchName",
"when": "false"
},
{
"command": "git.repositories.copyTagName",
"when": "false"
},
{
"command": "git.repositories.copyStashName",
"when": "false"
},
{
"command": "git.repositories.stashCopyBranchName",
"when": "false"
}
],
"scm/title": [
Expand Down Expand Up @@ -2090,6 +2162,16 @@
"group": "3_drop@3",
"when": "scmProvider == git && scmArtifactGroupId == stashes"
},
{
"command": "git.repositories.stashCopyBranchName",
"group": "4_copy@1",
"when": "scmProvider == git && scmArtifactGroupId == stashes"
},
{
"command": "git.repositories.copyStashName",
"group": "4_copy@2",
"when": "scmProvider == git && scmArtifactGroupId == stashes"
},
{
"command": "git.repositories.checkout",
"group": "1_checkout@1",
Expand Down Expand Up @@ -2130,6 +2212,21 @@
"group": "4_compare@1",
"when": "scmProvider == git && (scmArtifactGroupId == branches || scmArtifactGroupId == tags)"
},
{
"command": "git.repositories.copyCommitHash",
"group": "5_copy@2",
"when": "scmProvider == git && (scmArtifactGroupId == branches || scmArtifactGroupId == tags)"
},
{
"command": "git.repositories.copyBranchName",
"group": "5_copy@1",
"when": "scmProvider == git && scmArtifactGroupId == branches"
},
{
"command": "git.repositories.copyTagName",
"group": "5_copy@2",
"when": "scmProvider == git && scmArtifactGroupId == tags"
},
{
"command": "git.repositories.openWorktreeInNewWindow",
"group": "inline@1",
Expand All @@ -2149,6 +2246,21 @@
"command": "git.repositories.deleteWorktree",
"group": "2_modify@1",
"when": "scmProvider == git && scmArtifactGroupId == worktrees"
},
{
"command": "git.repositories.worktreeCopyCommitHash",
"group": "3_copy@2",
"when": "scmProvider == git && scmArtifactGroupId == worktrees"
},
{
"command": "git.repositories.worktreeCopyBranchName",
"group": "3_copy@1",
"when": "scmProvider == git && scmArtifactGroupId == worktrees"
},
{
"command": "git.repositories.worktreeCopyPath",
"group": "3_copy@3",
"when": "scmProvider == git && scmArtifactGroupId == worktrees"
}
],
"scm/resourceGroup/context": [
Expand Down
7 changes: 6 additions & 1 deletion extensions/git/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"command.stashView": "View Stash...",
"command.stashView2": "View Stash",
"command.timelineOpenDiff": "Open Changes",
"command.timelineCopyCommitId": "Copy Commit ID",
"command.timelineCopyCommitId": "Copy Commit Hash",
"command.timelineCopyCommitMessage": "Copy Commit Message",
"command.timelineSelectForCompare": "Select for Compare",
"command.timelineCompareWithSelected": "Compare with Selected",
Expand All @@ -148,6 +148,11 @@
"command.graphCompareWithMergeBase": "Compare with Merge Base",
"command.graphCompareWithRemote": "Compare with Remote",
"command.deleteRef": "Delete",
"command.artifactCopyCommitHash": "Copy Commit Hash",
"command.artifactCopyBranchName": "Copy Branch Name",
"command.artifactCopyTagName": "Copy Tag Name",
"command.artifactCopyStashName": "Copy Stash Name",
"command.artifactCopyWorktreePath": "Copy Worktree Path",
"command.blameToggleEditorDecoration": "Toggle Git Blame Editor Decoration",
"command.blameToggleStatusBarItem": "Toggle Git Blame Status Bar Item",
"command.api.getRepositories": "Get Repositories",
Expand Down
91 changes: 91 additions & 0 deletions extensions/git/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5415,6 +5415,97 @@ export class CommandCenter {
await repository.deleteWorktree(artifact.id);
}

@command('git.repositories.worktreeCopyBranchName', { repository: true })
async artifactWorktreeCopyBranchName(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {
return;
}

const worktrees = await repository.getWorktreeDetails();
const worktree = worktrees.find(w => w.path === artifact.id);
if (!worktree || worktree.detached) {
return;
}

env.clipboard.writeText(worktree.ref.substring(11));
}

@command('git.repositories.worktreeCopyCommitHash', { repository: true })
async artifactWorktreeCopyCommitHash(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {
return;
}

const worktrees = await repository.getWorktreeDetails();
const worktree = worktrees.find(w => w.path === artifact.id);
if (!worktree?.commitDetails) {
return;
}

env.clipboard.writeText(worktree.commitDetails.hash);
}

@command('git.repositories.worktreeCopyPath', { repository: true })
async artifactWorktreeCopyPath(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {
return;
}

env.clipboard.writeText(artifact.id);
}

@command('git.repositories.copyCommitHash', { repository: true })
async artifactCopyCommitHash(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {
return;
}

const commit = await repository.getCommit(artifact.id);
env.clipboard.writeText(commit.hash);
}

@command('git.repositories.copyBranchName', { repository: true })
async artifactCopyBranchName(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {
return;
}

env.clipboard.writeText(artifact.name);
}

@command('git.repositories.copyTagName', { repository: true })
async artifactCopyTagName(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {
return;
}

env.clipboard.writeText(artifact.name);
}

@command('git.repositories.copyStashName', { repository: true })
async artifactCopyStashName(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {
return;
}

env.clipboard.writeText(artifact.name);
}

@command('git.repositories.stashCopyBranchName', { repository: true })
async artifactStashCopyBranchName(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact?.description) {
return;
}

const stashes = await repository.getStashes();
const stash = stashes.find(s => artifact.id === `stash@{${s.index}}`);
if (!stash?.branchName) {
return;
}

env.clipboard.writeText(stash.branchName);
}

private createCommand(id: string, key: string, method: Function, options: ScmCommandOptions): (...args: any[]) => any {
const result = (...args: any[]) => {
let result: Promise<any>;
Expand Down
Loading