Last active
October 11, 2019 16:33
-
-
Save LeZuse/d1604defc19942b46fde1aaa2b75260c to your computer and use it in GitHub Desktop.
GitHub PR view & checkout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# prerequisites: brew install fzf hub | |
function prss() { | |
hub issue --include-pulls --color \ | |
--since=`date -u -v-1m +"%Y-%m-%dT%H:%M:%SZ"` \ | |
--format="%Cyellow%i%Creset %t %Cwhite@%au%Creset %l %Cyellow%cr%Creset%n" | \ | |
fzf --ansi --preview="echo {} | cut -d' ' -f1 | tr -d '#' | xargs -I % hub issue show %" | \ | |
cut -d' ' -f1 | tr -d '#' | \ | |
xargs -I {} sh -c 'git rev-parse --verify pr-{} || git fetch origin pull/{}/head:pr-{} && git checkout pr-{}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TODO
pr-XXX