This commit is contained in:
Michael Nikitochkin 2013-03-25 06:14:15 -07:00
commit 84caef394b
2 changed files with 29 additions and 0 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ custom/*
*.swp *.swp
!custom/example.zshcache !custom/example.zshcache
cache/ cache/
.idea

View file

@ -67,5 +67,33 @@ exist_gh() { # [DIRECTORY]
git push -u origin master git push -u origin master
} }
# If your branch named like [issue_number]_some_description
gh_issue() {
local ghissue
ghissue=`echo $(current_branch) | sed -e 's/\([0-9]*\).*/\1/'`
if [ $ghissue ]; then
echo "$ghissue"
fi
}
pull_request() {
local organization
if [ $1 ]; then
organization=$1
else
organization=$( git config --get remote.origin.url | sed "s/^[^:]*:\([^\/]*\)\/.*/\1/" )
fi
if [ $(gh_issue) ]; then
issue="-i $(gh_issue)"
else
issue=""
fi
echo "hub pull-request $(echo $issue) -b $organization:master -h $organization:$(current_branch)"
hub pull-request $(echo $issue) -b $organization:master -h $organization:$(current_branch)
}
# End Functions ############################################################# # End Functions #############################################################
alias gpr="pull_request"