Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added option to not prompt if commit message is empty (close #913) #920

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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