diff --git a/package.json b/package.json index f1e30eb..ca0f99c 100644 --- a/package.json +++ b/package.json @@ -1707,6 +1707,15 @@ "category": "GitLens" }, { + "command": "gitlens.showQuickRevisionDetails", + "title": "Show Revision Details", + "category": "GitLens", + "icon": { + "dark": "images/dark/icon-commit.svg", + "light": "images/light/icon-commit.svg" + } + }, + { "command": "gitlens.showQuickFileHistory", "title": "Show File History", "category": "GitLens" @@ -2403,7 +2412,11 @@ }, { "command": "gitlens.showQuickCommitFileDetails", - "when": "editorTextFocus && gitlens:activeFileStatus =~ /blameable/" + "when": "gitlens:activeFileStatus =~ /blameable/" + }, + { + "command": "gitlens.showQuickRevisionDetails", + "when": "gitlens:activeFileStatus =~ /revision/" }, { "command": "gitlens.showQuickFileHistory", @@ -2855,12 +2868,17 @@ "command": "gitlens.diffWithPrevious", "alt": "gitlens.diffWithRevision", "when": "!isInDiffEditor && gitlens:activeFileStatus =~ /tracked/ && config.gitlens.menus.editorGroup.compare", - "group": "navigation@98" + "group": "navigation@97" }, { "command": "gitlens.diffWithPreviousInDiff", "alt": "gitlens.diffWithRevision", "when": "isInDiffEditor && gitlens:activeFileStatus =~ /tracked/ && config.gitlens.menus.editorGroup.compare", + "group": "navigation@97" + }, + { + "command": "gitlens.showQuickRevisionDetails", + "when": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git", "group": "navigation@98" }, { diff --git a/src/commands/common.ts b/src/commands/common.ts index 7843db7..950f26c 100644 --- a/src/commands/common.ts +++ b/src/commands/common.ts @@ -58,12 +58,13 @@ export enum Commands { ShowFileHistoryExplorer = 'gitlens.showFileHistoryExplorer', ShowLineHistoryExplorer = 'gitlens.showLineHistoryExplorer', ShowLastQuickPick = 'gitlens.showLastQuickPick', + ShowQuickBranchHistory = 'gitlens.showQuickBranchHistory', ShowQuickCommitDetails = 'gitlens.showQuickCommitDetails', ShowQuickCommitFileDetails = 'gitlens.showQuickCommitFileDetails', - ShowQuickFileHistory = 'gitlens.showQuickFileHistory', - ShowQuickBranchHistory = 'gitlens.showQuickBranchHistory', ShowQuickCurrentBranchHistory = 'gitlens.showQuickRepoHistory', + ShowQuickFileHistory = 'gitlens.showQuickFileHistory', ShowQuickRepoStatus = 'gitlens.showQuickRepoStatus', + ShowQuickRevisionDetails = 'gitlens.showQuickRevisionDetails', ShowQuickStashList = 'gitlens.showQuickStashList', ShowRepositoriesExplorer = 'gitlens.showRepositoriesExplorer', ShowResultsExplorer = 'gitlens.showResultsExplorer', diff --git a/src/commands/showQuickCommitDetails.ts b/src/commands/showQuickCommitDetails.ts index 62868f4..7b10773 100644 --- a/src/commands/showQuickCommitDetails.ts +++ b/src/commands/showQuickCommitDetails.ts @@ -37,10 +37,17 @@ export class ShowQuickCommitDetailsCommand extends ActiveEditorCachedCommand { } constructor() { - super(Commands.ShowQuickCommitDetails); + super([Commands.ShowQuickCommitDetails, Commands.ShowQuickRevisionDetails]); } protected async preExecute(context: CommandContext, args: ShowQuickCommitDetailsCommandArgs = {}): Promise { + if (context.command === Commands.ShowQuickRevisionDetails && context.editor !== undefined) { + args = { ...args }; + + const gitUri = await GitUri.fromUri(context.editor.document.uri); + args.sha = gitUri.sha; + } + if (context.type === 'viewItem') { args = { ...args }; args.sha = context.node.uri.sha;