mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-05 01:35:37 -05:00
Refactors commit quick pick commands
Splits showQuickCommitDetails into showQuickCommitDetails and showQuickCommitFileDetails Adds closeUnchangedFiles command Adds openChangedFiles command Adds diffDirectory command Adds contextual description to the `go back` commands Fixes #44 by adding a warning message about Git version requirements Fixes intermittent errors when adding active line annotations Fixes intermittent errors when opening multiple files via quick picks Updates dependencies Preps v2.11.0
This commit is contained in:
@@ -4,11 +4,12 @@ import { BlameabilityTracker } from './blameabilityTracker';
|
||||
import { BlameActiveLineController } from './blameActiveLineController';
|
||||
import { BlameAnnotationController } from './blameAnnotationController';
|
||||
import { configureCssCharacters } from './blameAnnotationFormatter';
|
||||
import { CloseUnchangedFilesCommand, OpenChangedFilesCommand } from './commands';
|
||||
import { CopyMessageToClipboardCommand, CopyShaToClipboardCommand } from './commands';
|
||||
import { DiffLineWithPreviousCommand, DiffLineWithWorkingCommand, DiffWithPreviousCommand, DiffWithWorkingCommand} from './commands';
|
||||
import { DiffDirectoryCommand, DiffLineWithPreviousCommand, DiffLineWithWorkingCommand, DiffWithPreviousCommand, DiffWithWorkingCommand} from './commands';
|
||||
import { ShowBlameCommand, ToggleBlameCommand } from './commands';
|
||||
import { ShowBlameHistoryCommand, ShowFileHistoryCommand } from './commands';
|
||||
import { ShowQuickCommitDetailsCommand, ShowQuickFileHistoryCommand, ShowQuickRepoHistoryCommand, ShowQuickRepoStatusCommand} from './commands';
|
||||
import { ShowQuickCommitDetailsCommand, ShowQuickCommitFileDetailsCommand, ShowQuickFileHistoryCommand, ShowQuickRepoHistoryCommand, ShowQuickRepoStatusCommand} from './commands';
|
||||
import { ToggleCodeLensCommand } from './commands';
|
||||
import { Keyboard } from './commands';
|
||||
import { IAdvancedConfig, IBlameConfig } from './configuration';
|
||||
@@ -44,12 +45,19 @@ export async function activate(context: ExtensionContext) {
|
||||
catch (ex) {
|
||||
Logger.error(ex);
|
||||
if (ex.message.includes('Unable to find git')) {
|
||||
await window.showErrorMessage(`GitLens: Unable to find Git. Please make sure Git is installed. Also ensure that Git is either in the PATH, or that 'gitlens.advanced.git' is pointed to its installed location.`);
|
||||
await window.showErrorMessage(`GitLens was unable to find Git. Please make sure Git is installed. Also ensure that Git is either in the PATH, or that 'gitlens.advanced.git' is pointed to its installed location.`);
|
||||
}
|
||||
commands.executeCommand(BuiltInCommands.SetContext, 'gitlens:enabled', false);
|
||||
return;
|
||||
}
|
||||
|
||||
const version = Git.gitInfo().version;
|
||||
const [major, minor] = version.split('.');
|
||||
// If git is less than v2.2.0
|
||||
if (parseInt(major, 10) < 2 || parseInt(minor, 10) < 2) {
|
||||
await window.showErrorMessage(`GitLens requires a newer version of Git (>= 2.2.0) than is currently installed (${version}). Please install a more recent version of Git.`);
|
||||
}
|
||||
|
||||
let gitEnabled = workspace.getConfiguration('git').get<boolean>('enabled');
|
||||
commands.executeCommand(BuiltInCommands.SetContext, 'gitlens:enabled', gitEnabled);
|
||||
context.subscriptions.push(workspace.onDidChangeConfiguration(() => {
|
||||
@@ -79,8 +87,11 @@ export async function activate(context: ExtensionContext) {
|
||||
|
||||
context.subscriptions.push(new Keyboard(context));
|
||||
|
||||
context.subscriptions.push(new CloseUnchangedFilesCommand(git, repoPath));
|
||||
context.subscriptions.push(new OpenChangedFilesCommand(git, repoPath));
|
||||
context.subscriptions.push(new CopyMessageToClipboardCommand(git, repoPath));
|
||||
context.subscriptions.push(new CopyShaToClipboardCommand(git, repoPath));
|
||||
context.subscriptions.push(new DiffDirectoryCommand(git, repoPath));
|
||||
context.subscriptions.push(new DiffWithWorkingCommand(git));
|
||||
context.subscriptions.push(new DiffLineWithWorkingCommand(git));
|
||||
context.subscriptions.push(new DiffWithPreviousCommand(git));
|
||||
@@ -90,6 +101,7 @@ export async function activate(context: ExtensionContext) {
|
||||
context.subscriptions.push(new ShowBlameHistoryCommand(git));
|
||||
context.subscriptions.push(new ShowFileHistoryCommand(git));
|
||||
context.subscriptions.push(new ShowQuickCommitDetailsCommand(git));
|
||||
context.subscriptions.push(new ShowQuickCommitFileDetailsCommand(git));
|
||||
context.subscriptions.push(new ShowQuickFileHistoryCommand(git));
|
||||
context.subscriptions.push(new ShowQuickRepoHistoryCommand(git, repoPath));
|
||||
context.subscriptions.push(new ShowQuickRepoStatusCommand(git, repoPath));
|
||||
|
||||
Reference in New Issue
Block a user