feat: add 'gimmegit -c' to compare branches on GitHub#66
Merged
Conversation
There was a problem hiding this comment.
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/--compareflag 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 |
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.
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.