Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

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:

  • Standard comparison (separate base/head parameters): Shows all changes between commits, including merge commits. This is the default behavior.
  • Three-dot (...): Changes unique to head since common ancestor, excluding merge commits. Only supported via the basehead parameter format.

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 prompt

This 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.

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
Copilot AI requested a review from alexr00 January 9, 2026 09:11
// 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 ? '...' : '..';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot GitHub doesn't appear to support '..'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're absolutely right! The GitHub API only supports three-dot notation (...), not two-dot (..). I've updated the implementation to:

  • Use the standard compareCommits API with separate base and head parameters for the default comparison
  • Only use three-dot syntax (...) via compareCommitsWithBasehead when excluding merge commits

Fixed in commit 47a70ef.

Copilot AI requested a review from alexr00 January 9, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide merge commits from "changes since last review"

2 participants