From f499bffbc604c267f42120fcdffcb7b2f11423c8 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sat, 11 Mar 2017 04:09:58 -0500 Subject: [PATCH] Stops repo log from limiting to a single sha Gets log reverse to work --- src/git/git.ts | 6 ++++-- src/gitProvider.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/git/git.ts b/src/git/git.ts index c6283fa..2552c24 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -154,11 +154,13 @@ export default class Git { const [file, root]: [string, string] = Git.splitPath(Git.normalizePath(fileName), repoPath); const params = [...DefaultLogParams, `--follow`]; - if (maxCount) { + if (maxCount && !reverse) { params.push(`-n${maxCount}`); } if (sha) { if (reverse) { + params.push(`--reverse`); + params.push(`--ancestry-path`); params.push(`${sha}..HEAD`); } else { @@ -192,7 +194,7 @@ export default class Git { params.push(`-n${maxCount}`); } if (sha) { - params.push(`${sha}^!`); + params.push(sha); } return gitCommand(repoPath, ...params); } diff --git a/src/gitProvider.ts b/src/gitProvider.ts index f84781a..2855d70 100644 --- a/src/gitProvider.ts +++ b/src/gitProvider.ts @@ -506,7 +506,7 @@ export class GitProvider extends Disposable { } getLogForFile(fileName: string, sha?: string, repoPath?: string, range?: Range, maxCount?: number, reverse: boolean = false): Promise { - Logger.log(`getLogForFile('${fileName}', ${sha}, '${repoPath}', ${range && `[${range.start.line}, ${range.end.line}]`}, ${maxCount})`); + Logger.log(`getLogForFile('${fileName}', ${sha}, '${repoPath}', ${range && `[${range.start.line}, ${range.end.line}]`}, ${maxCount}, ${reverse})`); fileName = Git.normalizePath(fileName); const useCaching = this.UseGitCaching && !sha && !range && !maxCount;