WhichPR: Find a pull request with a commit hash

I released WhichPR v1.0.0 today🎉 WhichPR is a tool to find pull requests.

What’s this?

WhichPR is a command line tool for Git and GitHub. It finds a pull-request with a commit hash.

Installation

You can download a binary from release page. Please download a binary and place it in $PATH directory.

Usage

whichpr open and whichpr show commands are available.

# Display the pull-request number
$ whichpr show dc7eaf64ecb48e17524747ba78097bcb031ddc26
7
# Open the pull-request in your browser
$ whichpr open dc7eaf64ecb48e17524747ba78097bcb031ddc26

How to work, and configuration

It guesses a pull request number from commits log first time; if guessing is failed, it tries finding a pull request number with GitHub API.
So it needs an access token of GitHub in the first time of API request. For example:

$ whichpr open dc7eaf64ecb48e17524747ba78097bcb031ddc26
github.com username: <Enter your username>
github.com password for pocke (never stored): <Enter your password>
two-factor authentication code: <Enter 2FA code if you use 2FA>

You can write a configuration file if you do not want to enter the password.

# ~/.config/whichpr
github.com:
- user: <YOUR USER NAME OF GITHUB>
oauth_token: <A PERSONAL ACCESS TOKEN>
protocol: https

Thank you. Enjoy developing!