Browse Source

Fixes #259 - Don't use full-history on files

main
Eric Amodio 7 years ago
parent
commit
eda2375b84
2 changed files with 7 additions and 15 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +6
    -15
      src/git/git.ts

+ 1
- 0
CHANGELOG.md View File

@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [Unreleased]
### Fixed
- Fixes [#257](https://github.com/eamodio/vscode-gitlens/issues/257) - Some branches fail to show history
- Fixes [#259](https://github.com/eamodio/vscode-gitlens/issues/259) - File history lists unrelated merge commits
## [7.5.6] - 2018-01-22
### Changed

+ 6
- 15
src/git/git.ts View File

@ -42,7 +42,7 @@ const logFormat = [
`${lb}f${rb}`
].join('%n');
const defaultLogParams = ['log', '--name-status', '--full-history', '-M', `--format=${logFormat}`];
const defaultLogParams = ['log', '--name-status', '-M', `--format=${logFormat}`];
const stashFormat = [
`${lb}${sl}f${rb}`,
@ -55,7 +55,7 @@ const stashFormat = [
`${lb}f${rb}`
].join('%n');
const defaultStashParams = ['stash', 'list', '--name-status', '--full-history', '-M', `--format=${stashFormat}`];
const defaultStashParams = ['stash', 'list', '--name-status', '-M', `--format=${stashFormat}`];
const GitWarnings = [
/Not a git repository/,
@ -389,7 +389,7 @@ export class Git {
}
static log(repoPath: string, options: { maxCount?: number, ref?: string, reverse?: boolean }) {
const params = [...defaultLogParams, '-m'];
const params = [...defaultLogParams, '--full-history', '-m'];
if (options.maxCount && !options.reverse) {
params.push(`-n${options.maxCount}`);
}
@ -412,16 +412,7 @@ export class Git {
params.push(`-n${options.maxCount}`);
}
if (options.skipMerges) {
params.push('--no-merges');
}
else {
params.push('-m');
// If we are looking for a specific sha don't simplify merges
if (!options.ref || options.maxCount! > 2) {
params.push('--simplify-merges');
}
}
params.push(options.skipMerges ? '--no-merges' : '-m');
if (options.ref && !Git.isStagedUncommitted(options.ref)) {
if (options.reverse) {
@ -443,7 +434,7 @@ export class Git {
static async log_recent(repoPath: string, fileName: string) {
try {
const data = await gitCommandCore({ cwd: repoPath }, 'log', '--full-history', '-M', '-n1', '--format=%H', '--', fileName);
const data = await gitCommandCore({ cwd: repoPath }, 'log', '-M', '-n1', '--format=%H', '--', fileName);
return data.trim();
}
catch {
@ -453,7 +444,7 @@ export class Git {
static async log_resolve(repoPath: string, fileName: string, ref: string) {
try {
const data = await gitCommandCore({ cwd: repoPath }, 'log', '--full-history', '-M', '-n1', '--format=%H', ref, '--', fileName);
const data = await gitCommandCore({ cwd: repoPath }, 'log', '-M', '-n1', '--format=%H', ref, '--', fileName);
return data.trim();
}
catch {

Loading…
Cancel
Save