Skip to content

pr <cmd> <commit-ish> #12602

@Rudxain

Description

@Rudxain

Describe the feature or problem you’d like to solve

The GH web GUI is able to show the set of pull-requests from which a commit "comes from". It's sub-optimal (both for a human and computer) to open a browser to find those PRs for a given commit or tag, when it could be done from the CLI

Proposed solution

  • gh pr view <commit-ish> should try to resolve the associated PR; if there are more than 1, maybe prompt the user?
  • gh pr list --head <commit-ish> should only list "duplicate" PRs
  • gh pr list <commit-ish> should find all PRs that include that commit. If commit-ish is included in the base of such PRs, it can be ignored (unless there's a flag?)
  • gh pr create --head <commit-ish> should either:
    • do as if <commit-ish> is a temporary branch, as created by git checkout -b tmp <commit-ish>
    • prompt the user before doing something like git checkout -b tmp <base> && git cherry-pick <commit-ish>
  • etc... most other pr sub-cmds should be able to handle commits in some way

Additional context

None yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-prrelating to the gh pr commandneeds-triageneeds to be reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions