From 2f5e2c215ee6c6113536a80474accb6a8e4d87b3 Mon Sep 17 00:00:00 2001 From: Edgard Lorraine Messias Date: Wed, 6 May 2020 05:08:27 -0300 Subject: [PATCH] feat: Added option to not prompt if commit message is empty (close #913) (#920) --- README.md | 3 +++ package.json | 5 +++++ src/messages.ts | 8 +++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb5d8fee..c0edb54a 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,9 @@ Here are all of the extension settings with their default values. To change any // Select all files when commit changes "svn.commit.changes.selectedAll": true, + // Check empty message before commit + "svn.commit.checkEmptyMessage": true, + // Set file to status resolved after fix conflicts "svn.conflicts.autoResolve": null, diff --git a/package.json b/package.json index 6794f251..408a9fbb 100644 --- a/package.json +++ b/package.json @@ -1009,6 +1009,11 @@ "description": "Select all files when commit changes", "default": true }, + "svn.commit.checkEmptyMessage": { + "type": "boolean", + "description": "Check empty message before commit", + "default": true + }, "svn.conflicts.autoResolve": { "type": "boolean", "description": "Set file to status resolved after fix conflicts", diff --git a/src/messages.ts b/src/messages.ts index 2b339d0a..3fc89f5e 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -1,6 +1,7 @@ import * as path from "path"; import { commands, Uri, ViewColumn, WebviewPanel, window } from "vscode"; import { SourceControlManager } from "./source_control_manager"; +import { configuration } from "./helpers/configuration"; export function noChangesToCommit() { return window.showInformationMessage("There are no changes to commit."); @@ -231,7 +232,12 @@ export async function inputCommitMessage( message = await showCommitInput(message, filePaths); } - if (message === "") { + const checkEmptyMessage = configuration.get( + "commit.checkEmptyMessage", + true + ); + + if (message === "" && checkEmptyMessage) { const allowEmpty = await window.showWarningMessage( "Do you really want to commit an empty message?", { modal: true },