Skip to content

Commit

Permalink
feat: Added option to not prompt if commit message is empty (close #913
Browse files Browse the repository at this point in the history
…) (#920)
  • Loading branch information
edgardmessias committed May 6, 2020
1 parent 40b0448 commit 2f5e2c2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 7 additions & 1 deletion src/messages.ts
Original file line number Diff line number Diff line change
@@ -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.");
Expand Down Expand Up @@ -231,7 +232,12 @@ export async function inputCommitMessage(
message = await showCommitInput(message, filePaths);
}

if (message === "") {
const checkEmptyMessage = configuration.get<boolean>(
"commit.checkEmptyMessage",
true
);

if (message === "" && checkEmptyMessage) {
const allowEmpty = await window.showWarningMessage(
"Do you really want to commit an empty message?",
{ modal: true },
Expand Down

0 comments on commit 2f5e2c2

Please sign in to comment.