Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show in amending commit list only the first parents #6242

Merged
merged 1 commit into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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