Skip to content

Conversation

@sideshowbarker
Copy link

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.

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.

@sideshowbarker sideshowbarker force-pushed the auto-detect-pr branch 3 times, most recently from 3621e6a to 14b18ee Compare January 18, 2026 22:41
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.
@danobi
Copy link
Owner

danobi commented Jan 20, 2026

Thanks for the PR! I will take a look tomorrow.

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