Created
March 10, 2016 01:23
-
-
Save bennovakovic/ad1b246a32b1963cb7bb to your computer and use it in GitHub Desktop.
Quickly the github PR review page from the current branch
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 | |
# Running with no arguments opens against release, | |
# but pass one argument to open against that branch: | |
# $ git-pr master | |
# $ git-pr | |
MAIN_BRANCH='release' | |
if [ -n "$1" ]; then | |
MAIN_BRANCH=$1 | |
fi | |
CURRENT_BRANCH=`git branch 2>/dev/null | grep '*' | sed 's/* \(.*\)/\1/'` | |
URL=`git remote -v 2> /dev/null | grep '(push)' | awk '{print $2}'` | |
if [ -n "$URL" ]; then | |
URL="$URL/compare/$MAIN_BRANCH...$CURRENT_BRANCH" | |
open $URL | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment