Skip to content

Instantly share code, notes, and snippets.

@deltam
Last active January 17, 2021 07:14
Show Gist options
  • Save deltam/ece26cc805a073068c0e95b699a21614 to your computer and use it in GitHub Desktop.
Save deltam/ece26cc805a073068c0e95b699a21614 to your computer and use it in GitHub Desktop.
コミットIDからマージされたプルリクを開くやつ
#!/bin/sh
# 参考 Commit Hash から、該当 Pull Request を見つける方法 - Qiita https://qiita.com/awakia/items/f14dc6310e469964a8f7
GITHUB_URL=`git config --get remote.origin.url | sed -E 's#^.+(github.com):(.+)\.git$#https://\1/\2#'`
git log --merges --oneline --reverse --ancestry-path $1...master | grep -m 1 "Merge pull request" | cut -f5 -d ' ' | sed "s@#@${GITHUB_URL}/pull/@" |xargs open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment