-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Now that a better pr create #238 has landed and supports submitting PRs from one's fork, we should address some edge-cases that arise in the light of new features.
After cloning your own fork, doing some work, and running gh pr create within that repo, the improved base repo resolution mechanism will kick in and submit the PR to the parent repo of the fork, since it's little likely that the person wants to open a PR in their own fork.
However, when running gh pr status or pr list, their fork will be queried instead of the parent repo and there will usually be no results.
This is because the base repo resolution is now different in pr create and other commands: other commands don't look up repository information from API; they simply assume that the upstream or origin git remote points to the base repo.
We should consider expanding the base lookup logic from pr create to all other commands for consistency, but that might incur a small delay before running every command. There might be other approaches to compensate for speed:
- automatically add an
upstreamremote to point to base iforiginis detected to be a fork; - look up the base repository via API on every command, but cache the result per-repo.