Skip to content

Commit eda2375

Browse files
committed
Fixes #259 - Don't use full-history on files
1 parent 10c345d commit eda2375

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
77
## [Unreleased]
88
### Fixed
99
- Fixes [#257](https://github.com/eamodio/vscode-gitlens/issues/257) - Some branches fail to show history
10+
- Fixes [#259](https://github.com/eamodio/vscode-gitlens/issues/259) - File history lists unrelated merge commits
1011

1112
## [7.5.6] - 2018-01-22
1213
### Changed

src/git/git.ts

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const logFormat = [
4242
`${lb}f${rb}`
4343
].join('%n');
4444

45-
const defaultLogParams = ['log', '--name-status', '--full-history', '-M', `--format=${logFormat}`];
45+
const defaultLogParams = ['log', '--name-status', '-M', `--format=${logFormat}`];
4646

4747
const stashFormat = [
4848
`${lb}${sl}f${rb}`,
@@ -55,7 +55,7 @@ const stashFormat = [
5555
`${lb}f${rb}`
5656
].join('%n');
5757

58-
const defaultStashParams = ['stash', 'list', '--name-status', '--full-history', '-M', `--format=${stashFormat}`];
58+
const defaultStashParams = ['stash', 'list', '--name-status', '-M', `--format=${stashFormat}`];
5959

6060
const GitWarnings = [
6161
/Not a git repository/,
@@ -389,7 +389,7 @@ export class Git {
389389
}
390390

391391
static log(repoPath: string, options: { maxCount?: number, ref?: string, reverse?: boolean }) {
392-
const params = [...defaultLogParams, '-m'];
392+
const params = [...defaultLogParams, '--full-history', '-m'];
393393
if (options.maxCount && !options.reverse) {
394394
params.push(`-n${options.maxCount}`);
395395
}
@@ -412,16 +412,7 @@ export class Git {
412412
params.push(`-n${options.maxCount}`);
413413
}
414414

415-
if (options.skipMerges) {
416-
params.push('--no-merges');
417-
}
418-
else {
419-
params.push('-m');
420-
// If we are looking for a specific sha don't simplify merges
421-
if (!options.ref || options.maxCount! > 2) {
422-
params.push('--simplify-merges');
423-
}
424-
}
415+
params.push(options.skipMerges ? '--no-merges' : '-m');
425416

426417
if (options.ref && !Git.isStagedUncommitted(options.ref)) {
427418
if (options.reverse) {
@@ -443,7 +434,7 @@ export class Git {
443434

444435
static async log_recent(repoPath: string, fileName: string) {
445436
try {
446-
const data = await gitCommandCore({ cwd: repoPath }, 'log', '--full-history', '-M', '-n1', '--format=%H', '--', fileName);
437+
const data = await gitCommandCore({ cwd: repoPath }, 'log', '-M', '-n1', '--format=%H', '--', fileName);
447438
return data.trim();
448439
}
449440
catch {
@@ -453,7 +444,7 @@ export class Git {
453444

454445
static async log_resolve(repoPath: string, fileName: string, ref: string) {
455446
try {
456-
const data = await gitCommandCore({ cwd: repoPath }, 'log', '--full-history', '-M', '-n1', '--format=%H', ref, '--', fileName);
447+
const data = await gitCommandCore({ cwd: repoPath }, 'log', '-M', '-n1', '--format=%H', ref, '--', fileName);
457448
return data.trim();
458449
}
459450
catch {

0 commit comments

Comments
 (0)