Skip to content

Add GitHub PR comparison command#130

Merged
letmaik merged 13 commits intomasterfrom
copilot/add-github-pr-view-feature
Jan 25, 2026
Merged

Add GitHub PR comparison command#130
letmaik merged 13 commits intomasterfrom
copilot/add-github-pr-view-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 25, 2026

Implementation Complete: GitHub PR Comparison Feature

✅ Completed Tasks

  • Add @octokit/rest dependency for GitHub API calls
  • Create new command "Compare GitHub Pull Request" in package.json
  • Add command to view/title menu (main "..." menu)
  • Implement GitHub authentication using vscode.authentication.getSession
  • Implement PR URL parsing to extract owner, repo, and PR number
  • Implement GitHub API call to fetch PR details (base and head refs)
  • Implement git operations to:
    • Fetch the PR head branch (handles both forks and same-repo PRs)
    • Checkout the head branch in detached HEAD state
    • Compare to the base ref using existing comparison logic
  • Add command registration in extension.ts
  • Implement the command handler in treeProvider.ts
  • Build successfully compiles
  • Add safety check for uncommitted changes
  • Add comprehensive documentation to README
  • Run security checks (CodeQL: 0 alerts found)
  • Resolve merge conflicts with master branch

🔄 Merge Conflicts Resolved

Merged latest changes from master including:

  • New sorting commands (sortByName, sortByPath, sortByStatus, sortByRecentlyModified)
  • New difftool integration (openChangesWithDifftool)
  • View & Sort submenu
  • All features integrated successfully

🎯 Feature Summary

Successfully implemented "Compare GitHub Pull Request" feature that allows users to:

  1. Enter a GitHub PR URL
  2. Automatically authenticate with GitHub (via VS Code)
  3. Fetch and checkout the PR
  4. View all PR changes in the Git Tree Compare tree view

🔒 Security

  • Passed CodeQL security scan with 0 alerts
  • Uses VS Code's secure built-in GitHub authentication
  • No secrets or credentials hardcoded

📝 Files Modified

  • package.json - Added dependency, command registration, and merged with new commands
  • src/extension.ts - Registered command handler and merged with new handlers
  • src/treeProvider.ts - Implemented main feature logic and merged with new methods
  • README.md - Added feature documentation and merged with new settings
Original prompt

This section details on the original issue you should resolve

<issue_title>Quickly view a github PR via Git Tree Compare</issue_title>
<issue_description>Let me start by saying how wonderful this extension is. I have three extensions that I consider completely essential can't work without, and this is one of them. Thank you for making this.

I'd like to request a new feature. I find the github PR diff viewing experience just awful. It would be nice if this extension would let me drop the pr url, and it can checkout the feature branch and compare it to the same commit the pr is comparing it to. Its not too hard to do myself, so I get if its not added, but the shortcut would be nice.

Thanks!</issue_description>

<agent_instructions>make sure to check the docs online to figure out how auth to github works in vs code.
add this as a new context menu item in the tree view "..." main menu</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 and others added 3 commits January 25, 2026 09:56
…tion

Co-authored-by: letmaik <530988+letmaik@users.noreply.github.com>
Co-authored-by: letmaik <530988+letmaik@users.noreply.github.com>
Co-authored-by: letmaik <530988+letmaik@users.noreply.github.com>
Copilot AI changed the title [WIP] Add feature to view GitHub PRs in Git Tree Compare Add GitHub PR comparison command Jan 25, 2026
Copilot AI requested a review from letmaik January 25, 2026 10:05
@letmaik
Copy link
Copy Markdown
Owner

letmaik commented Jan 25, 2026

@copilot resolve merge conflicts

Co-authored-by: letmaik <530988+letmaik@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 25, 2026

@copilot resolve merge conflicts

Merge conflicts resolved in commit 6f85f75. The GitHub PR comparison feature has been successfully integrated with the latest changes from master, including the new sorting commands and difftool integration.

@letmaik letmaik marked this pull request as ready for review January 25, 2026 15:19
@letmaik letmaik merged commit f350fb2 into master Jan 25, 2026
2 checks passed
@letmaik letmaik deleted the copilot/add-github-pr-view-feature branch January 25, 2026 17:04
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.

Quickly view a github PR via Git Tree Compare

2 participants