Use three-dot comparison to exclude merge commits from "changes since last review"#8379
Draft
Use three-dot comparison to exclude merge commits from "changes since last review"#8379
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Hide merge commits from changes since last review
Use three-dot comparison to exclude merge commits from "changes since last review"
Jan 9, 2026
alexr00
requested changes
Jan 9, 2026
src/github/loggingOctokit.ts
Outdated
| // Use three-dot syntax when excluding merge commits to show only changes unique to the head branch | ||
| // since it diverged from the base. This naturally excludes changes from merge commits. | ||
| // Two-dot syntax (default) shows all changes between base and head, including merge commits. | ||
| const dotSeparator = excludeMergeCommits ? '...' : '..'; |
Contributor
Author
There was a problem hiding this comment.
You're absolutely right! The GitHub API only supports three-dot notation (...), not two-dot (..). I've updated the implementation to:
- Use the standard
compareCommitsAPI with separatebaseandheadparameters for the default comparison - Only use three-dot syntax (
...) viacompareCommitsWithBaseheadwhen excluding merge commits
Fixed in commit 47a70ef.
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When viewing "changes since last review", merge commits were included in the diff. GitHub's web UI excludes these by using three-dot comparison syntax.
Changes
src/github/loggingOctokit.ts: AddedexcludeMergeCommitsparameter tocompareCommits(). When true, uses three-dot syntax (base...head) viacompareCommitsWithBaseheadendpoint. When false (default), uses standardcompareCommitsendpoint with separatebaseandheadparameters.src/github/pullRequestModel.ts: PassshowChangesSinceReviewflag tocompareCommits()to enable merge commit filteringTechnical Detail
GitHub API comparison modes:
...): Changes unique to head since common ancestor, excluding merge commits. Only supported via thebaseheadparameter format.Note: The GitHub API does not support two-dot (
..) notation. The standard comparison using separatebaseandheadparameters is equivalent to a two-dot comparison behavior, while three-dot syntax must be explicitly used via thebaseheadparameter.The three-dot comparison naturally filters out changes brought in by merge commits (e.g., merging main into a feature branch), matching web UI behavior.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.