Skip to content

Commit 2f5e2c2

Browse files
feat: Added option to not prompt if commit message is empty (close #913) (#920)
1 parent 40b0448 commit 2f5e2c2

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ Here are all of the extension settings with their default values. To change any
7272
// Select all files when commit changes
7373
"svn.commit.changes.selectedAll": true,
7474

75+
// Check empty message before commit
76+
"svn.commit.checkEmptyMessage": true,
77+
7578
// Set file to status resolved after fix conflicts
7679
"svn.conflicts.autoResolve": null,
7780

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,11 @@
10091009
"description": "Select all files when commit changes",
10101010
"default": true
10111011
},
1012+
"svn.commit.checkEmptyMessage": {
1013+
"type": "boolean",
1014+
"description": "Check empty message before commit",
1015+
"default": true
1016+
},
10121017
"svn.conflicts.autoResolve": {
10131018
"type": "boolean",
10141019
"description": "Set file to status resolved after fix conflicts",

src/messages.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as path from "path";
22
import { commands, Uri, ViewColumn, WebviewPanel, window } from "vscode";
33
import { SourceControlManager } from "./source_control_manager";
4+
import { configuration } from "./helpers/configuration";
45

56
export function noChangesToCommit() {
67
return window.showInformationMessage("There are no changes to commit.");
@@ -231,7 +232,12 @@ export async function inputCommitMessage(
231232
message = await showCommitInput(message, filePaths);
232233
}
233234

234-
if (message === "") {
235+
const checkEmptyMessage = configuration.get<boolean>(
236+
"commit.checkEmptyMessage",
237+
true
238+
);
239+
240+
if (message === "" && checkEmptyMessage) {
235241
const allowEmpty = await window.showWarningMessage(
236242
"Do you really want to commit an empty message?",
237243
{ modal: true },

0 commit comments

Comments
 (0)