Created
September 28, 2016 11:22
-
-
Save flomotlik/394f7e1a674a6cb451e2a4aecf6c6a6e to your computer and use it in GitHub Desktop.
Pull Request handling
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
# Checkout a PR from the current repo | |
function copr { git fetch origin pull/$1/head:pr-$1; git checkout pr-$1; } | |
# Get the current PR from the branch name | |
function current_pr { | |
git rev-parse --abbrev-ref HEAD | grep -oE "\d+" | |
} | |
# Update the PR | |
function upr { | |
pr=$(current_pr) | |
echo "Pulling for PR: $pr" | |
git pull origin pull/$pr/head | |
} | |
# Open the PR in the browser | |
function opr { | |
pr=$(current_pr) | |
echo "Opening PR: $pr" | |
open "https://github.com/serverless/serverless/pull/$pr" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment