Skip to content

Find PR given commit hash #4160

@eugeneotto

Description

@eugeneotto

Describe the feature or problem you’d like to solve

When I'm exploring a repository, I like to review the PR associated with a given commit since it will often include helpful context that doesn't make it into the commit message.

To hop from a commit hash to the associated PR, I do the following:

  1. Discover an interesting commit via git log|show|blame
  2. Manually open a URL like this in my browser: https://github.com/organization/repository/commits/commit-hash
  3. Click the little PR link below the commit message

Proposed solution

gh pr find commit-hash

This would ideally print the PR's URL on a single line so it composes with other utilities, like open.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions