Repository navigation
Fix NameError in git-webkit review with a branch argument - #78222
Open
TheRealAlexxx wants to merge 1 commit into
Open
TheRealAlexxx wants to merge 1 commit into
TheRealAlexxx wants to merge 1 commit into
Conversation
https://bugs.webkit.org/show_bug.cgi?id=321220 Reviewed by NOBODY (OOPS!). git-webkit review accepts a pull-request number, a URL, or a branch name. The branch-name path calls PullRequest.find_existing_pull_request(repository, rmt, branch=target), but no variable named rmt exists in that scope, so every review by branch name crashes with NameError. This includes the reported git-webkit review --dry-run HEAD. See https://bugs.webkit.org/show_bug.cgi?id=321220. Pass the remote repository, which is what the variable was meant to be. In addition, resolve HEAD to the current branch when running from a local checkout, so the reported command reviews the pull-request for the branch you have checked out instead of failing to find a branch literally named HEAD. Without a local checkout, HEAD cannot be resolved and the command reports that plainly. A new test creates a pull-request in a mock repository and reviews it both by branch name and as HEAD, checking that each command completes instead of crashing. ``` PYTHONPATH=Tools/Scripts/libraries/webkitscmpy:Tools/Scripts python3 -m unittest webkitscmpy.test.review_unittest webkitscmpy.test.pull_request_unittest python3 Tools/Scripts/check-webkit-style Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/review.py Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/review_unittest.py ```
TheRealAlexxx
requested review from
JonWBedard,
briannafan,
facetothefate and
gsnedders
as code owners
October 25, 2026 11:41
Collaborator
|
EWS run on current version of this PR (hash 8372ec7) Details |
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.
Fix NameError in git-webkit review with a branch argument
git-webkit review accepts a pull-request number, a URL, or a branch name. The branch-name path calls PullRequest.find_existing_pull_request(repository, rmt, branch=target), but no variable named rmt exists in that scope, so every review by branch name crashes with NameError. This includes the reported git-webkit review --dry-run HEAD. See https://bugs.webkit.org/show_bug.cgi?id=321220.
Pass the remote repository, which is what the variable was meant to be. In addition, resolve HEAD to the current branch when running from a local checkout, so the reported command reviews the pull-request for the branch you have checked out instead of failing to find a branch literally named HEAD. Without a local checkout, HEAD cannot be resolved and the command reports that plainly.
A new test creates a pull-request in a mock repository and reviews it both by branch name and as HEAD, checking that each command completes instead of crashing.