Skip to content

Commit

Permalink
Show in amending commit list only the first parents
Browse files Browse the repository at this point in the history
Signed-off-by: Nigel Westbury <nigelipse@miegel.org>
  • Loading branch information
westbury authored and kittaakos committed Sep 23, 2019
1 parent ccb3502 commit 2aa8f23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/git/src/browser/git-scm-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ export class GitAmendSupport implements ScmAmendSupport {
this.repository,
{
range: { toRevision: amendingHeadCommitSha, fromRevision: latestCommitSha },
firstParent: true,
maxCount: 50
}
);
Expand Down
4 changes: 4 additions & 0 deletions packages/git/src/common/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ export namespace Git {
*/
readonly shortSha?: boolean;

/**
* Return only commits reached by following the first parent, giving a linear list of commits.
*/
readonly firstParent?: boolean;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/git/src/node/dugite-git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,9 @@ export class DugiteGit implements Git {
if (options && options.branch) {
args.push(options.branch);
}
if (options && options.firstParent) {
args.push('--first-parent');
}
const range = this.mapRange((options || {}).range);
args.push(...[range, '-C', '-M', '-m']);
const maxCount = options && options.maxCount ? options.maxCount : 0;
Expand Down

0 comments on commit 2aa8f23

Please sign in to comment.