Adds blame information in the statusBar

Add new StatusBar settings -- see **Extension Settings** above for details
Renames the `gitlens.codeLens.recentChange.command` & `gitlens.codeLens.authors.command` settings options (to align with command names)
Adds new `gitlens.diffWithPrevious` option to the `gitlens.codeLens.recentChange.command` & `gitlens.codeLens.authors.command` settings
Fixes Diff with Previous when the selection is uncommited
Removes `gitlens.blame.annotation.useCodeActions` setting and behavior
This commit is contained in:
Eric Amodio
2016-09-21 02:02:49 -04:00
parent c4b8637946
commit 834b4904db
12 changed files with 359 additions and 220 deletions

View File

@@ -53,7 +53,7 @@ export default class Git {
return gitCommand(cwd, 'rev-parse', '--show-toplevel').then(data => data.replace(/\r?\n|\r/g, '').replace(/\\/g, '/'));
}
static blame(format: GitBlameFormat, fileName: string, repoPath?: string, sha?: string) {
static blame(format: GitBlameFormat, fileName: string, sha?: string, repoPath?: string) {
const [file, root]: [string, string] = Git.splitPath(Git.normalizePath(fileName), repoPath);
if (sha) {
@@ -62,11 +62,20 @@ export default class Git {
return gitCommand(root, 'blame', format, '--root', '--', file);
}
static blameLines(format: GitBlameFormat, fileName: string, startLine: number, endLine: number, sha?: string, repoPath?: string) {
const [file, root]: [string, string] = Git.splitPath(Git.normalizePath(fileName), repoPath);
if (sha) {
return gitCommand(root, 'blame', `-L ${startLine},${endLine}`, format, '--root', `${sha}^`, '--', file);
}
return gitCommand(root, 'blame', `-L ${startLine},${endLine}`, format, '--root', '--', file);
}
static getVersionedFile(fileName: string, repoPath: string, sha: string) {
return new Promise<string>((resolve, reject) => {
Git.getVersionedFileText(fileName, repoPath, sha).then(data => {
const ext = path.extname(fileName);
tmp.file({ prefix: `${path.basename(fileName, ext)}-${sha}_`, postfix: ext }, (err, destination, fd, cleanupCallback) => {
tmp.file({ prefix: `${path.basename(fileName, ext)}-${sha}__`, postfix: ext }, (err, destination, fd, cleanupCallback) => {
if (err) {
reject(err);
return;