mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-28 17:25:09 -05:00
Switches to porcelain blame format
Provides more data (commit message, previous commit, etc)
This commit is contained in:
17
src/git.ts
17
src/git.ts
@@ -23,7 +23,7 @@ export default class Git {
|
||||
|
||||
if (sha) {
|
||||
console.log('git', 'blame', '-fn', '--root', `${sha}^`, '--', fileName);
|
||||
return gitCommand(repoPath, 'blame', '-fnw', '--root', `${sha}^`, '--', fileName);
|
||||
return gitCommand(repoPath, 'blame', '-fn', '--root', `${sha}^`, '--', fileName);
|
||||
}
|
||||
|
||||
console.log('git', 'blame', '-fn', '--root', '--', fileName);
|
||||
@@ -32,6 +32,20 @@ export default class Git {
|
||||
// .catch(ex => console.error(ex));
|
||||
}
|
||||
|
||||
static blamePorcelain(fileName: string, repoPath: string, sha?: string) {
|
||||
fileName = Git.normalizePath(fileName, repoPath);
|
||||
|
||||
if (sha) {
|
||||
console.log('git', 'blame', '--porcelain', '--root', `${sha}^`, '--', fileName);
|
||||
return gitCommand(repoPath, 'blame', '--porcelain', '--root', `${sha}^`, '--', fileName);
|
||||
}
|
||||
|
||||
console.log('git', 'blame', '--porcelain', '--root', '--', fileName);
|
||||
return gitCommand(repoPath, 'blame', '--porcelain', '--root', '--', fileName);
|
||||
// .then(s => { console.log(s); return s; })
|
||||
// .catch(ex => console.error(ex));
|
||||
}
|
||||
|
||||
static getVersionedFile(fileName: string, repoPath: string, sha: string) {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
Git.getVersionedFileText(fileName, repoPath, sha).then(data => {
|
||||
@@ -79,6 +93,7 @@ export default class Git {
|
||||
static getCommitMessages(fileName: string, repoPath: string) {
|
||||
fileName = Git.normalizePath(fileName, repoPath);
|
||||
|
||||
// git log --format="%h (%aN %x09 %ai) %s" --
|
||||
console.log('git', 'log', '--oneline', '--', fileName);
|
||||
return gitCommand(repoPath, 'log', '--oneline', '--', fileName);
|
||||
// .then(s => { console.log(s); return s; })
|
||||
|
||||
Reference in New Issue
Block a user