From 963120ba87db146a5f74e310b6bbe7879b1c3781 Mon Sep 17 00:00:00 2001 From: Phil Marshall Date: Fri, 4 Oct 2019 16:35:31 -0500 Subject: [PATCH 1/2] add git.showCommitInput config option (#79074) --- extensions/git/package.json | 6 ++++++ extensions/git/package.nls.json | 1 + extensions/git/src/repository.ts | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/extensions/git/package.json b/extensions/git/package.json index b64dfb4707e..f2932e369dc 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -1410,6 +1410,12 @@ ], "default": "committerdate", "description": "%config.branchSortOrder%" + }, + "git.showCommitInput": { + "type": "boolean", + "scope": "resource", + "default": true, + "description": "%config.showCommitInput%" } } }, diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index 6587b65421d..0488a07c431 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -128,6 +128,7 @@ "config.openDiffOnClick": "Controls whether the diff editor should be opened when clicking a change. Otherwise the regular editor will be opened.", "config.supportCancellation": "Controls whether a notification comes up when running the Sync action, which allows the user to cancel the operation.", "config.branchSortOrder": "Controls the sort order for branches.", + "config.showCommitInput": "Controls whether to show the commit input in the Git source control panel.", "colors.added": "Color for added resources.", "colors.modified": "Color for modified resources.", "colors.deleted": "Color for deleted resources.", diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index fadd1ac6e74..f5fb7acc5e7 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -700,6 +700,18 @@ export class Repository implements Disposable { const onConfigListenerForBranchSortOrder = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.branchSortOrder', root)); onConfigListenerForBranchSortOrder(this.updateModelState, this, this.disposables); + const updateInputBoxVisibility = () => { + console.log('this is running!'); + const config = workspace.getConfiguration('git', root); + const inputConfig = config.get('showCommitInput'); + this._sourceControl.inputBox.visible = (inputConfig === undefined) ? true : inputConfig; + }; + + const onConfigListenerForInputBoxVisibility = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.showCommitInput', root)); + onConfigListenerForInputBoxVisibility(updateInputBoxVisibility, this, this.disposables); + updateInputBoxVisibility(); + + this.mergeGroup.hideWhenEmpty = true; this.disposables.push(this.mergeGroup); From 1acd0359f7ea6e8d97ed48e5387649a0089a4c31 Mon Sep 17 00:00:00 2001 From: Phil Marshall Date: Fri, 4 Oct 2019 16:51:58 -0500 Subject: [PATCH 2/2] remove console log --- extensions/git/src/repository.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index f5fb7acc5e7..278d7e3ac9d 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -701,7 +701,6 @@ export class Repository implements Disposable { onConfigListenerForBranchSortOrder(this.updateModelState, this, this.disposables); const updateInputBoxVisibility = () => { - console.log('this is running!'); const config = workspace.getConfiguration('git', root); const inputConfig = config.get('showCommitInput'); this._sourceControl.inputBox.visible = (inputConfig === undefined) ? true : inputConfig;