mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Added to github plugin function to send pull requests from current branch. added alias and added rule to ignore idea files.
This commit is contained in:
parent
22f827e122
commit
e0d4e48bda
2 changed files with 29 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -7,3 +7,4 @@ custom/*
|
|||
*.swp
|
||||
!custom/example.zshcache
|
||||
cache/
|
||||
.idea
|
||||
|
|
@ -66,5 +66,33 @@ exist_gh() { # [DIRECTORY]
|
|||
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 $issue -b $organization:master -h $organization:$(current_branch)"
|
||||
hub pull-request $issue -b $organization:master -h $organization:$(current_branch)
|
||||
}
|
||||
|
||||
# End Functions #############################################################
|
||||
|
||||
alias gpr="pull_request"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue