Created
October 9, 2014 03:39
-
-
Save mrowe/70a20dca77ba4496e35c to your computer and use it in GitHub Desktop.
Viewing GitHub pull request diffs
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
folder-hook REA 'macro pager \Cd '<pipe-message>~/dotfiles/mutt/view_git_patch.sh^M' |
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
#!/bin/bash | |
if [ "$1" = "-p" ] ; then | |
type=patch | |
else | |
type=diff | |
fi | |
egrep "^http.*\.${type}$" \ | |
| sed -e "s|git.realestate.com.au/|git.realestate.com.au/api/v3/repos/|" -e "s/pull/pulls/" -e "s/\.${type}$//" \ | |
| xargs curl -s -H "Accept: application/vnd.github.VERSION.${type}" \ | |
-H "Authorization: token $GITHUB_ACCESS_TOKEN" \ | |
| colordiff \ | |
| less -R |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment