diff --git a/contributions.json b/contributions.json index 7073eb9835674..4cb7c29be06c4 100644 --- a/contributions.json +++ b/contributions.json @@ -1719,6 +1719,19 @@ ] } }, + "gitlens.graph.compareSelectedCommits.multi": { + "label": "Compare Selected Commits", + "icon": "$(compare-changes)", + "menus": { + "webview/context": [ + { + "when": "webviewItems =~ /gitlens:commit\\b/ && listDoubleSelection", + "group": "4_gitlens_compare", + "order": 2 + } + ] + } + }, "gitlens.graph.compareWithHead": { "label": "Compare to/from HEAD", "icon": "$(compare-changes)", diff --git a/package.json b/package.json index 4d2d438973406..21de123199916 100644 --- a/package.json +++ b/package.json @@ -6401,6 +6401,11 @@ "title": "Compare with HEAD", "icon": "$(compare-changes)" }, + { + "command": "gitlens.graph.compareSelectedCommits.multi", + "title": "Compare Selected Commits", + "icon": "$(compare-changes)" + }, { "command": "gitlens.graph.compareWithHead", "title": "Compare to/from HEAD", @@ -10353,6 +10358,10 @@ "command": "gitlens.graph.compareBranchWithHead", "when": "false" }, + { + "command": "gitlens.graph.compareSelectedCommits.multi", + "when": "false" + }, { "command": "gitlens.graph.compareWithHead", "when": "false" @@ -18502,6 +18511,11 @@ "command": "gitlens.graph.openCommitOnRemote.multi", "when": "webviewItems =~ /gitlens:commit\\b/ && listMultiSelection && gitlens:repos:withRemotes", "group": "3_gitlens_explore@2" + }, + { + "command": "gitlens.graph.compareSelectedCommits.multi", + "when": "webviewItems =~ /gitlens:commit\\b/ && listDoubleSelection", + "group": "4_gitlens_compare@2" } ] }, diff --git a/src/constants.commands.ts b/src/constants.commands.ts index a69800fc4fd17..7f7d9ac455cd0 100644 --- a/src/constants.commands.ts +++ b/src/constants.commands.ts @@ -801,7 +801,8 @@ type GraphWebviewCommands = `graph.${ | 'openWorktree' | 'openWorktreeInNewWindow' | 'copyWorkingChangesToWorktree' - | 'generateCommitMessage'}`; + | 'generateCommitMessage' + | 'compareSelectedCommits.multi'}`; type TimelineWebviewCommands = `timeline.${'refresh' | 'split'}`; diff --git a/src/plus/webviews/graph/graphWebview.ts b/src/plus/webviews/graph/graphWebview.ts index c178162b78d53..0f8176322a76d 100644 --- a/src/plus/webviews/graph/graphWebview.ts +++ b/src/plus/webviews/graph/graphWebview.ts @@ -685,11 +685,12 @@ export class GraphWebviewProvider implements WebviewProvider