From 4241b7ba7ff0ed6e538e9293150204ed49d35f5f Mon Sep 17 00:00:00 2001 From: Jan Holubec Date: Sat, 10 Dec 2016 18:07:08 +0100 Subject: [PATCH 1/2] Whitespace changes will be ignored --- package.json | 2 +- src/gitblame.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b0962113..1d83ba04 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "compile": "node ./node_modules/vscode/bin/compile -watch -p ./" }, "dependencies": { - "git-blame": "^0.1.1", + "git-blame": "^1.1.0", "moment": "^2.10.6", "path": "^0.12.7", "typescript": "^1.6.2", diff --git a/src/gitblame.ts b/src/gitblame.ts index 86a77be4..071e03d6 100644 --- a/src/gitblame.ts +++ b/src/gitblame.ts @@ -38,7 +38,8 @@ export class GitBlame { }; self.gitBlameProcess(repo, { - file: fileName + file: fileName, + ignoreWhitespaces: true }).on('data', (type, data) => { // outputs in Porcelain format. if (type === 'line') { From bc2a02084832778679f1b4de9a4dba8652817ec6 Mon Sep 17 00:00:00 2001 From: Jan Holubec Date: Sat, 10 Dec 2016 23:40:45 +0100 Subject: [PATCH 2/2] Configuration option --- package.json | 12 +++++++++++- src/gitblame.ts | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1d83ba04..9d1f9e3f 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,16 @@ "commands": [{ "command": "extension.blame", "title": "Git Blame" - }] + }], + "configuration": { + "title": "Git Blame configuration", + "properties": { + "git-blame.ignore-whitespace-change":{ + "type": "boolean", + "default": true, + "description" : "If set to true, git blame command will ignore any whitespace change applied to currently selected line" + } + } + } } } diff --git a/src/gitblame.ts b/src/gitblame.ts index 071e03d6..78741cbd 100644 --- a/src/gitblame.ts +++ b/src/gitblame.ts @@ -1,4 +1,4 @@ - +import * as vscode from 'vscode'; export class GitBlame { @@ -39,7 +39,7 @@ export class GitBlame { self.gitBlameProcess(repo, { file: fileName, - ignoreWhitespaces: true + ignoreWhitespaces: vscode.workspace.getConfiguration('git-blame').get("ignore-whitespace-change", true) }).on('data', (type, data) => { // outputs in Porcelain format. if (type === 'line') {