mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
Merge a77a113f8f into 0ab0e67ecf
This commit is contained in:
commit
84caef394b
2 changed files with 29 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -7,3 +7,4 @@ custom/*
|
||||||
*.swp
|
*.swp
|
||||||
!custom/example.zshcache
|
!custom/example.zshcache
|
||||||
cache/
|
cache/
|
||||||
|
.idea
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue