nix/modules/home-manager/scripts/common/bin/pr-for-commit

11 lines
282 B
Plaintext
Raw Normal View History

2023-09-05 13:52:52 -05:00
#!/usr/bin/env sh
GITHUB_UPSTREAM="$(git remote -vv | awk '{$0=$2}')"
git log --merges --ancestry-path --oneline "$1"..master \
| grep -i 'pull request' \
| tail -n1 \
| awk '{$0=$5}' \
| cut -c2- \
| xargs -I % open https://github.com/"$GITHUB_UPSTREAM"/"${PWD##*/}"/pull/%