Sorry, something went wrong.
| // 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 ? '...' : '..'; |
There was a problem hiding this comment.
@copilot GitHub doesn't appear to support '..'.
Sorry, something went wrong.
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:
Fixed in commit 47a70ef.
Sorry, something went wrong.
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: Added excludeMergeCommits parameter to compareCommits(). When true, uses three-dot syntax (base...head) via compareCommitsWithBasehead endpoint. When false (default), uses standard compareCommits endpoint with separate base and head parameters.
src/github/pullRequestModel.ts: Pass showChangesSinceReview flag to compareCommits() to enable merge commit filtering
Technical Detail
GitHub API comparison modes:
Note: The GitHub API does not support two-dot (..) notation. The standard comparison using separate base and head parameters is equivalent to a two-dot comparison behavior, while three-dot syntax must be explicitly used via the basehead parameter.
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 promptThis section details on the original issue you should resolve
<issue_title>Hide merge commits from "changes since last review"</issue_title>
<issue_description>
Like with the web view, changes from merge commits shouldn't be shown when viewing changes since the last review.</issue_description>
<agent_instructions>Pay special attention to this comment: #4510 (comment)</agent_instructions>
Comments on the Issue (you are @copilot in this section)
💡 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.