Skip to content

feat: add 'gimmegit -c' to compare branches on GitHub#66

Merged
dwilding merged 5 commits intomainfrom
open-compare
Dec 11, 2025
Merged

feat: add 'gimmegit -c' to compare branches on GitHub#66
dwilding merged 5 commits intomainfrom
open-compare

Conversation

@dwilding
Copy link
Copy Markdown
Owner

@dwilding dwilding commented Dec 11, 2025

This PR adds a command gimmegit -c. When run inside a gimmegit clone, this command opens GitHub's "Comparing changes" page, to compare the review branch with the base branch. If output is not going to a terminal, or gimmegit can't open a browser, gimmegit outputs the page URL instead.

Copilot AI review requested due to automatic review settings December 11, 2025 03:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new -c/--compare command to gimmegit that opens a GitHub comparison URL between the upstream main branch and the current review branch in a web browser.

Key changes:

  • Added -c/--compare flag to enable branch comparison on GitHub
  • Implemented browser-opening functionality with fallback to URL output
  • Updated error messages for consistency

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/gimmegit/_args.py Added -c/--compare argument parsing and validation logic
src/gimmegit/_cli.py Implemented compare_usage function to open comparison URLs in browser
src/gimmegit/_help.py Added documentation for the new -c/--compare command
tests/functional/test_clone.py Added test cases for compare functionality with and without remote
tests/functional/test_arg_errors.py Added test to verify error handling when combining -c with repository arguments
tests/functional/test_outer.py Updated error message to match new consistent wording

Comment thread src/gimmegit/_args.py
Comment thread src/gimmegit/_cli.py Outdated
Comment thread src/gimmegit/_cli.py Outdated
@dwilding dwilding merged commit 1d528af into main Dec 11, 2025
4 checks passed
@dwilding dwilding deleted the open-compare branch December 11, 2025 05:48
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.

2 participants