feat: Auto-detect repo and PR from current git branch#78
Open
sideshowbarker wants to merge 3 commits intodanobi:masterfrom
Open
feat: Auto-detect repo and PR from current git branch#78sideshowbarker wants to merge 3 commits intodanobi:masterfrom
sideshowbarker wants to merge 3 commits intodanobi:masterfrom
Conversation
3621e6a to
14b18ee
Compare
This change enables running “prr get”, “prr edit”, or “prr submit” without an argument — in which case, prr now auto-detects the repo and PR number by: 1. Parsing the git remote URL: tries “upstream” first (for fork workflows), then, if that's not found, falls back to “origin”. 2. Getting the current branch name. 3. Querying the GitHub API for the PR associated with that branch. For fork workflows, the “upstream” remote identifies the repository to query, while the “origin” remote identifies the fork owner for the head branch filter. When invoked from inside a GitHub repo clone on a PR branch, all that enables you to just run “prr get”, “prr edit”, or “prr submit” with no argument.
14b18ee to
bba9b1c
Compare
Owner
|
Thanks for the PR! I will take a look tomorrow. |
danobi
reviewed
Jan 23, 2026
Owner
danobi
left a comment
There was a problem hiding this comment.
Feature seems useful! Overall seems reasonable, some nits below.
Add `upstream_remote` and `origin_remote` optional fields to the
`[local]` config section in `.prr.toml`. These override the default
remote names ("upstream" and "origin") used when auto-detecting the
repository and PR from the current git branch. Useful for setups
where remotes are named differently.
Instead of silently picking the first PR, error out and ask the user to specify the PR explicitly — the ambiguity is too risky.
a4e5fcb to
1ee5071
Compare
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 change enables running
prr get,prr edit, orprr submitwithout an argument — in which case,prrnow auto-detects the repo and PR number by:When invoked from inside a GitHub repo clone on a PR branch, all that enables you to just run
prr get,prr edit, orprr submitwith no argument.