Browse Source

Fixes #1368 - allows suppressing missing git msg

main
Eric Amodio 4 years ago
parent
commit
e27da912e1
5 changed files with 20 additions and 3 deletions
  1. +4
    -0
      CHANGELOG.md
  2. +5
    -0
      package.json
  3. +1
    -0
      src/config.ts
  4. +1
    -3
      src/extension.ts
  5. +9
    -0
      src/messages.ts

+ 4
- 0
CHANGELOG.md View File

@ -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

+ 5
- 0
package.json View File

@ -2496,6 +2496,7 @@
"suppressCreatePullRequestPrompt": false,
"suppressFileNotUnderSourceControlWarning": false,
"suppressGitDisabledWarning": false,
"suppressGitMissingWarning": false,
"suppressGitVersionWarning": false,
"suppressImproperWorkspaceCasingWarning": false,
"suppressLineUncommittedWarning": false,
@ -2523,6 +2524,10 @@
"type": "boolean",
"default": false
},
"suppressGitMissingWarning": {
"type": "boolean",
"default": false
},
"suppressGitVersionWarning": {
"type": "boolean",
"default": false

+ 1
- 0
src/config.ts View File

@ -306,6 +306,7 @@ export interface AdvancedConfig {
suppressCreatePullRequestPrompt: boolean;
suppressFileNotUnderSourceControlWarning: boolean;
suppressGitDisabledWarning: boolean;
suppressGitMissingWarning: boolean;
suppressGitVersionWarning: boolean;
suppressImproperWorkspaceCasingWarning: boolean;
suppressLineUncommittedWarning: boolean;

+ 1
- 3
src/extension.ts View File

@ -133,9 +133,7 @@ export async function activate(context: ExtensionContext): Promise
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;

+ 9
- 0
src/messages.ts View File

@ -10,6 +10,7 @@ export enum SuppressedMessages {
CreatePullRequestPrompt = 'suppressCreatePullRequestPrompt',
FileNotUnderSourceControlWarning = 'suppressFileNotUnderSourceControlWarning',
GitDisabledWarning = 'suppressGitDisabledWarning',
GitMissingWarning = 'suppressGitMissingWarning',
GitVersionWarning = 'suppressGitVersionWarning',
IncorrectWorkspaceCasingWarning = 'suppressImproperWorkspaceCasingWarning',
LineUncommittedWarning = 'suppressLineUncommittedWarning',
@ -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',

Loading…
Cancel
Save