Skip to content

Commit

Permalink
Fixes #1368 - allows suppressing missing git msg
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Feb 9, 2021
1 parent 39b0fd4 commit e27da91
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Changes the _Blame Previous Revision_ command on the hover to _Open Blame Prior to this Change_
- Changes the _Blame Previous Revision_ command icon on the hover to the `versions` codicon

### Fixed

- Fixes [1368](https://github.com/eamodio/vscode-gitlens/issues/1368) - Suppress message "GitLens was unable to find Git"

## [11.2.1] - 2021-02-02

### Changed
Expand Down
5 changes: 5 additions & 0 deletions package.json
Expand Up @@ -2496,6 +2496,7 @@
"suppressCreatePullRequestPrompt": false,
"suppressFileNotUnderSourceControlWarning": false,
"suppressGitDisabledWarning": false,
"suppressGitMissingWarning": false,
"suppressGitVersionWarning": false,
"suppressImproperWorkspaceCasingWarning": false,
"suppressLineUncommittedWarning": false,
Expand Down Expand Up @@ -2523,6 +2524,10 @@
"type": "boolean",
"default": false
},
"suppressGitMissingWarning": {
"type": "boolean",
"default": false
},
"suppressGitVersionWarning": {
"type": "boolean",
"default": false
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Expand Up @@ -306,6 +306,7 @@ export interface AdvancedConfig {
suppressCreatePullRequestPrompt: boolean;
suppressFileNotUnderSourceControlWarning: boolean;
suppressGitDisabledWarning: boolean;
suppressGitMissingWarning: boolean;
suppressGitVersionWarning: boolean;
suppressImproperWorkspaceCasingWarning: boolean;
suppressLineUncommittedWarning: boolean;
Expand Down
4 changes: 1 addition & 3 deletions src/extension.ts
Expand Up @@ -133,9 +133,7 @@ export async function activate(context: ExtensionContext): Promise<GitLensApi |

const msg: string = ex?.message ?? '';
if (msg.includes('Unable to find git')) {
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 'git.path' is pointed to its installed location.",
);
void Messages.showGitMissingErrorMessage();
}

return undefined;
Expand Down
9 changes: 9 additions & 0 deletions src/messages.ts
Expand Up @@ -10,6 +10,7 @@ export enum SuppressedMessages {
CreatePullRequestPrompt = 'suppressCreatePullRequestPrompt',
FileNotUnderSourceControlWarning = 'suppressFileNotUnderSourceControlWarning',
GitDisabledWarning = 'suppressGitDisabledWarning',
GitMissingWarning = 'suppressGitMissingWarning',
GitVersionWarning = 'suppressGitVersionWarning',
IncorrectWorkspaceCasingWarning = 'suppressImproperWorkspaceCasingWarning',
LineUncommittedWarning = 'suppressLineUncommittedWarning',
Expand Down Expand Up @@ -85,6 +86,14 @@ export class Messages {
);
}

static showGitMissingErrorMessage() {
return Messages.showMessage(
'error',
"GitLens was unable to find Git. Please make sure Git is installed. Also ensure that Git is either in the PATH, or that 'git.path' is pointed to its installed location.",
SuppressedMessages.GitMissingWarning,
);
}

static showGitVersionUnsupportedErrorMessage(version: string, required: string): Promise<MessageItem | undefined> {
return Messages.showMessage(
'error',
Expand Down

0 comments on commit e27da91

Please sign in to comment.