This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/common/bin/pr-for-commit

11 lines
282 B
Plaintext
Raw Permalink Normal View History

2020-02-21 12:39:47 -06:00
#!/usr/bin/env sh
2020-04-20 10:38:19 -05:00
GITHUB_UPSTREAM="$(git remote -vv | awk '{$0=$2}')"
2020-02-21 12:39:47 -06:00
2020-04-20 10:38:19 -05:00
git log --merges --ancestry-path --oneline "$1"..master \
2020-02-21 12:39:47 -06:00
| grep -i 'pull request' \
| tail -n1 \
| awk '{$0=$5}' \
| cut -c2- \
2020-04-20 10:38:19 -05:00
| xargs -I % open https://github.com/"$GITHUB_UPSTREAM"/"${PWD##*/}"/pull/%