diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b7cdb8..da2960a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,21 @@ ## Release Notes ### 2.2.1 - - Overhauls the `gitlens.showQuickRepoHistory`, `gitlens.showQuickFileHistory`, and `gitlens.showQuickCommitDetails` quickpick lists - - Adds `Show Repository History` command to `gitlens.showQuickFileHistory` quickpick list - - Adds `Show Previous Commits History` command to `gitlens.showQuickCommitDetails` quickpick list - - Adds `Show Commits History` command to `gitlens.showQuickCommitDetails` quickpick list - - Adds `Copy Commit Sha to Clipboard` command to `gitlens.showQuickCommitDetails` quickpick list - - Adds `Show Changed Files` command to `gitlens.showQuickCommitDetails` quickpick list - - Adds more robust `go back` navigation in quickpick lists - - Adds commit message to placeholder text of many quickpick lists + - Overhauls the `gitlens.showQuickRepoHistory`, `gitlens.showQuickFileHistory`, and `gitlens.showQuickCommitDetails` quick pick lists + - Adds `Show Repository History` command to `gitlens.showQuickFileHistory` quick pick list + - Adds `Show Previous Commits History` command to `gitlens.showQuickCommitDetails` quick pick list + - Adds `Show Commits History` command to `gitlens.showQuickCommitDetails` quick pick list + - Adds `Copy Commit Sha to Clipboard` command to `gitlens.showQuickCommitDetails` quick pick list + - Adds `Show Changed Files` command to `gitlens.showQuickCommitDetails` quick pick list + - Adds more robust `go back` navigation in quick pick lists + - Adds commit message to placeholder text of many quick pick lists - Adds icons for some commands - Adds `gitlens.diffWithPrevious` command to the editor content menu - Adds `gitlens.diffWithWorking` command to the editor content menu - - Changes the default command of `gitlens.codeLens.recentChange.command` to `gitlens.showQuickFileHistory` + - Adds `gitlens.showQuickRepoHistory` and `gitlens.showQuickCommitDetails` commands to CodeLens + - Adds `gitlens.showQuickRepoHistory` and `gitlens.showQuickCommitDetails` commands to the status bar + - Changes the default command of `gitlens.codeLens.recentChange.command` to `gitlens.showQuickCommitDetails` + - Changes the default command of `gitlens.statusBar.command` to `gitlens.showQuickCommitDetails` - Changes behavior of `gitlens.showQuickFileHistory` when executed via CodeLens to open commit details directly - Changes `gitlens.diffWithPrevious` command to behave as `gitlens.diffWithWorking` if the file has uncommitted changes - Renames `gitlens.diffWithPrevious` command from `Diff Commit with Previous` to `Compare with Previous Commit` @@ -21,7 +24,7 @@ - Renames `gitlens.diffLineWithWorking` command from `Diff Commit (line) with Working Tree` to `Compare Line with Working Tree` - Fixes issues with certain git commands not working on Windows - Fixes [#31](https://github.com/eamodio/vscode-gitlens/issues/31) - Disable gitlens if the project does not have `.git` folder - - Fixes issue where quickpick lists could fail if there was no active editor + - Fixes issue where quick pick lists could fail if there was no active editor - Fixes CodeLens not updating in response to configuration changes ### 2.1.1 @@ -34,8 +37,8 @@ - Adds `alt+w` shortcut for the `gitlens.diffLineWithWorking` command - Adds `shift+alt+w` shortcut for the `gitlens.diffWithWorking` command - Adds `gitlens.copyShaToClipboard` to copy commit sha to the clipboard ([#28](https://github.com/eamodio/vscode-gitlens/issues/28)) - - Adds `gitlens.showQuickCommitDetails` to show a quickpick list of details for a commit - - Adds `go back` choice to `gitlens.showQuickCommitDetails`, `gitlens.showQuickFileHistory`, and `gitlens.showQuickRepoHistory` quickpick lists + - Adds `gitlens.showQuickCommitDetails` to show a quick pick list of details for a commit + - Adds `go back` choice to `gitlens.showQuickCommitDetails`, `gitlens.showQuickFileHistory`, and `gitlens.showQuickRepoHistory` quick pick lists - Adds `gitlens.blame.annotation.highlight` to specify whether and how to highlight blame annotations ([#24](https://github.com/eamodio/vscode-gitlens/issues/24)) - Greatly improves performance of line navigation when either active line annotations or status bar blame is enabled - Fixes [#29](https://github.com/eamodio/vscode-gitlens/issues/29) - Commit info tooltip duplicated for current line when blame is enabled diff --git a/README.md b/README.md index 0f4ad61..74cf7e5 100644 --- a/README.md +++ b/README.md @@ -41,12 +41,12 @@ Provides Git CodeLens information (most recent commit, # of authors), on-demand |`gitlens.codeLens.locationCustomSymbols`|Specifies the set of document symbols to render active document CodeLens on. Must be a member of `SymbolKind` |`gitlens.codeLens.languageLocations`|Specifies where CodeLens will be rendered in the active document for the specified languages |`gitlens.codeLens.recentChange.enabled`|Specifies whether the recent change CodeLens is shown -|`gitlens.codeLens.recentChange.command`|Specifies the command executed when the recent change CodeLens is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickFileHistory` - shows a file history picker +|`gitlens.codeLens.recentChange.command`|"Specifies the command executed when the recent change CodeLens is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickFileHistory` - shows a repository history quick pick |`gitlens.codeLens.authors.enabled`|Specifies whether the authors CodeLens is shown -|`gitlens.codeLens.authors.command`|Specifies the command executed when the authors CodeLens is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickFileHistory` - shows a file history picker +|`gitlens.codeLens.authors.command`|Specifies the command executed when the authors CodeLens is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickFileHistory` - shows a repository history quick pick |`gitlens.menus.diff.enabled`|Specifies whether diff commands will be added to the context menus |`gitlens.statusBar.enabled`|Specifies whether blame information is shown in the status bar -|`gitlens.statusBar.command`|"Specifies the command executed when the blame status bar item is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickFileHistory` - shows a file history picker +|`gitlens.statusBar.command`|"Specifies the command executed when the blame status bar item is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickFileHistory` - shows a repository history quick pick ## Known Issues diff --git a/package.json b/package.json index b02b93b..ee5d6b5 100644 --- a/package.json +++ b/package.json @@ -209,15 +209,17 @@ }, "gitlens.codeLens.recentChange.command": { "type": "string", - "default": "gitlens.showQuickFileHistory", + "default": "gitlens.showQuickCommitDetails", "enum": [ "gitlens.toggleBlame", "gitlens.showBlameHistory", "gitlens.showFileHistory", "gitlens.diffWithPrevious", - "gitlens.showQuickFileHistory" + "gitlens.showQuickCommitDetails", + "gitlens.showQuickFileHistory", + "gitlens.showQuickRepoHistory" ], - "description": "Specifies the command executed when the recent change CodeLens is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickFileHistory` - shows a file history picker" + "description": "Specifies the command executed when the recent change CodeLens is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickFileHistory` - shows a repository history quick pick" }, "gitlens.codeLens.authors.enabled": { "type": "boolean", @@ -232,9 +234,11 @@ "gitlens.showBlameHistory", "gitlens.showFileHistory", "gitlens.diffWithPrevious", - "gitlens.showQuickFileHistory" + "gitlens.showQuickCommitDetails", + "gitlens.showQuickFileHistory", + "gitlens.showQuickRepoHistory" ], - "description": "Specifies the command executed when the authors CodeLens is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickFileHistory` - shows a file history picker" + "description": "Specifies the command executed when the authors CodeLens is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickFileHistory` - shows a repository history quick pick" }, "gitlens.menus.diff.enabled": { "type": "boolean", @@ -248,16 +252,18 @@ }, "gitlens.statusBar.command": { "type": "string", - "default": "gitlens.showQuickFileHistory", + "default": "gitlens.showQuickCommitDetails", "enum": [ "gitlens.toggleBlame", "gitlens.showBlameHistory", "gitlens.showFileHistory", "gitlens.diffWithPrevious", "gitlens.toggleCodeLens", - "gitlens.showQuickFileHistory" + "gitlens.showQuickCommitDetails", + "gitlens.showQuickFileHistory", + "gitlens.showQuickRepoHistory" ], - "description": "Specifies the command executed when the blame status bar item is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickFileHistory` - shows a file history picker" + "description": "Specifies the command executed when the blame status bar item is clicked. `gitlens.toggleBlame` - toggles blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current checked-in file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickFileHistory` - shows a repository history quick pick" }, "gitlens.advanced.caching.enabled": { "type": "boolean", diff --git a/src/blameActiveLineController.ts b/src/blameActiveLineController.ts index e91ada3..af96a59 100644 --- a/src/blameActiveLineController.ts +++ b/src/blameActiveLineController.ts @@ -226,9 +226,15 @@ export default class BlameActiveLineController extends Disposable { case StatusBarCommand.ToggleCodeLens: this._statusBarItem.tooltip = 'Toggle Git CodeLens'; break; + case StatusBarCommand.ShowQuickFileHistory: + this._statusBarItem.tooltip = 'Show Commit Details'; + break; case StatusBarCommand.ShowQuickFileHistory: this._statusBarItem.tooltip = 'Show File History'; break; + case StatusBarCommand.ShowQuickFileHistory: + this._statusBarItem.tooltip = 'Show Repository History'; + break; } this._statusBarItem.show(); diff --git a/src/configuration.ts b/src/configuration.ts index 1254063..bbf6ca2 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -26,13 +26,15 @@ export interface IBlameConfig { }; } -export type CodeLensCommand = 'gitlens.toggleBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.diffWithPrevious' | 'gitlens.showQuickFileHistory'; +export type CodeLensCommand = 'gitlens.toggleBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.diffWithPrevious' | 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory'; export const CodeLensCommand = { BlameAnnotate: Commands.ToggleBlame as CodeLensCommand, ShowBlameHistory: Commands.ShowBlameHistory as CodeLensCommand, ShowFileHistory: Commands.ShowFileHistory as CodeLensCommand, DiffWithPrevious: Commands.DiffWithPrevious as CodeLensCommand, - ShowQuickFileHistory: Commands.ShowQuickFileHistory as CodeLensCommand + ShowQuickCommitDetails: Commands.ShowQuickCommitDetails as CodeLensCommand, + ShowQuickFileHistory: Commands.ShowQuickFileHistory as CodeLensCommand, + ShowQuickRepoHistory: Commands.ShowQuickRepoHistory as CodeLensCommand }; export type CodeLensLocation = 'all' | 'document+containers' | 'document' | 'custom' | 'none'; @@ -71,14 +73,16 @@ export interface ICodeLensesConfig { authors: ICodeLensConfig; } -export type StatusBarCommand = 'gitlens.toggleBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.toggleCodeLens' | 'gitlens.diffWithPrevious' | 'gitlens.showQuickFileHistory'; +export type StatusBarCommand = 'gitlens.toggleBlame' | 'gitlens.showBlameHistory' | 'gitlens.showFileHistory' | 'gitlens.toggleCodeLens' | 'gitlens.diffWithPrevious' | 'gitlens.showQuickCommitDetails' | 'gitlens.showQuickFileHistory' | 'gitlens.showQuickRepoHistory'; export const StatusBarCommand = { BlameAnnotate: Commands.ToggleBlame as StatusBarCommand, ShowBlameHistory: Commands.ShowBlameHistory as StatusBarCommand, ShowFileHistory: Commands.ShowFileHistory as CodeLensCommand, DiffWithPrevious: Commands.DiffWithPrevious as StatusBarCommand, ToggleCodeLens: Commands.ToggleCodeLens as StatusBarCommand, - ShowQuickFileHistory: Commands.ShowQuickFileHistory as StatusBarCommand + ShowQuickCommitDetails: Commands.ShowQuickCommitDetails as StatusBarCommand, + ShowQuickFileHistory: Commands.ShowQuickFileHistory as StatusBarCommand, + ShowQuickRepoHistory: Commands.ShowQuickRepoHistory as StatusBarCommand }; export interface IStatusBarConfig { diff --git a/src/gitCodeLensProvider.ts b/src/gitCodeLensProvider.ts index 263814b..c8da939 100644 --- a/src/gitCodeLensProvider.ts +++ b/src/gitCodeLensProvider.ts @@ -212,7 +212,9 @@ export default class GitCodeLensProvider implements CodeLensProvider { case CodeLensCommand.ShowBlameHistory: return this._applyShowBlameHistoryCommand(title, lens, blame, recentCommit); case CodeLensCommand.ShowFileHistory: return this._applyShowFileHistoryCommand(title, lens, blame, recentCommit); case CodeLensCommand.DiffWithPrevious: return this._applyDiffWithPreviousCommand(title, lens, blame, recentCommit); + case CodeLensCommand.ShowQuickCommitDetails: return this._applyShowQuickCommitDetailsCommand(title, lens, blame, recentCommit); case CodeLensCommand.ShowQuickFileHistory: return this._applyShowQuickFileHistoryCommand(title, lens, blame, recentCommit); + case CodeLensCommand.ShowQuickRepoHistory: return this._applyShowQuickRepoHistoryCommand(title, lens, blame, recentCommit); default: return lens; } } @@ -227,7 +229,9 @@ export default class GitCodeLensProvider implements CodeLensProvider { case CodeLensCommand.ShowBlameHistory: return this._applyShowBlameHistoryCommand(title, lens, blame); case CodeLensCommand.ShowFileHistory: return this._applyShowFileHistoryCommand(title, lens, blame); case CodeLensCommand.DiffWithPrevious: return this._applyDiffWithPreviousCommand(title, lens, blame); + case CodeLensCommand.ShowQuickCommitDetails: return this._applyShowQuickCommitDetailsCommand(title, lens, blame); case CodeLensCommand.ShowQuickFileHistory: return this._applyShowQuickFileHistoryCommand(title, lens, blame); + case CodeLensCommand.ShowQuickRepoHistory: return this._applyShowQuickRepoHistoryCommand(title, lens, blame); default: return lens; } } @@ -295,7 +299,7 @@ export default class GitCodeLensProvider implements CodeLensProvider { return lens; } - _applyShowQuickFileHistoryCommand(title: string, lens: T, blame: IGitBlameLines, commit?: GitCommit): T { + _applyShowQuickCommitDetailsCommand(title: string, lens: T, blame: IGitBlameLines, commit?: GitCommit): T { lens.command = { title: title, command: CodeLensCommand.ShowQuickFileHistory, @@ -303,4 +307,22 @@ export default class GitCodeLensProvider implements CodeLensProvider { }; return lens; } + + _applyShowQuickFileHistoryCommand(title: string, lens: T, blame: IGitBlameLines, commit?: GitCommit): T { + lens.command = { + title: title, + command: CodeLensCommand.ShowQuickFileHistory, + arguments: [Uri.file(lens.uri.fsPath)] + }; + return lens; + } + + _applyShowQuickRepoHistoryCommand(title: string, lens: T, blame: IGitBlameLines, commit?: GitCommit): T { + lens.command = { + title: title, + command: CodeLensCommand.ShowQuickRepoHistory, + arguments: [Uri.file(lens.uri.fsPath)] + }; + return lens; + } } \ No newline at end of file