提交 ce4bc1a7 编写于 作者: J Joao Moreno

git.enableLongCommitWarning config option

上级 e7a9a0da
......@@ -527,6 +527,11 @@ export function registerContributions(): void {
type: 'boolean',
description: nls.localize('gitAutoFetch', "Whether auto fetching is enabled."),
default: true
},
'git.enableLongCommitWarning': {
type: 'boolean',
description: nls.localize('gitLongCommit', "Whether long commit messages should be warned about."),
default: true
}
}
});
......
......@@ -40,6 +40,7 @@ import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
import {IEventService} from 'vs/platform/event/common/event';
import {CommonKeybindings} from 'vs/base/common/keyCodes';
import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService';
import {IConfigurationService} from 'vs/platform/configuration/common/configuration';
import IGitService = git.IGitService;
......@@ -87,7 +88,8 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IGitService gitService: IGitService,
@IOutputService outputService: IOutputService,
@IEventService eventService: IEventService
@IEventService eventService: IEventService,
@IConfigurationService private configurationService: IConfigurationService
) {
super();
......@@ -134,12 +136,19 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
validationOptions: {
showMessage: true,
validation: (value): InputBox.IMessage => {
const config = this.configurationService.getConfiguration<git.IGitConfiguration>('git');
if (!config.enableLongCommitWarning) {
return null;
}
if (Strings.trim(value.split('\n')[0]).length > 50) {
return {
content: ChangesView.LONG_COMMIT,
type: InputBox.MessageType.WARNING
};
}
return null;
}
},
......
......@@ -227,8 +227,10 @@ export var ServiceOperations = {
// Service config
export interface IGitConfiguration {
enabled: boolean;
path: string;
autofetch: boolean;
enableLongCommitWarning: boolean;
}
// Service interfaces
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册