mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Fixed bugs in repo, added missing command 'rebase'
This commit is contained in:
parent
f2116cf01c
commit
2d795a2f02
2 changed files with 33 additions and 4 deletions
|
|
@ -1,5 +1,21 @@
|
||||||
#compdef repo
|
#compdef repo
|
||||||
|
|
||||||
|
|
||||||
|
__git_apply_whitespace_strategies ()
|
||||||
|
{
|
||||||
|
declare -a strategies
|
||||||
|
|
||||||
|
strategies=(
|
||||||
|
'nowarn:turn off the trailing-whitespace warning'
|
||||||
|
'warn:output trailing-whitespace warning, but apply patch'
|
||||||
|
'fix:output trailing-whitespace warning and strip trailing whitespace'
|
||||||
|
'error:output trailing-whitespace warning and refuse to apply patch'
|
||||||
|
'error-all:same as "error", but output warnings for all files')
|
||||||
|
|
||||||
|
_describe -t strategies 'trailing-whitespace resolution strategy' strategies $*
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
_repo()
|
_repo()
|
||||||
{
|
{
|
||||||
local context state state_descr line curcontext="$curcontext"
|
local context state state_descr line curcontext="$curcontext"
|
||||||
|
|
@ -34,11 +50,12 @@ _repo()
|
||||||
'list:List projects and their associated directories'
|
'list:List projects and their associated directories'
|
||||||
'overview:Display overview of unmerged project branches'
|
'overview:Display overview of unmerged project branches'
|
||||||
'prune:Prune (delete) already merged topics'
|
'prune:Prune (delete) already merged topics'
|
||||||
'push:Push the local branch rebase:Rebase local branches on upstream branch'
|
'push:Push the local branch'
|
||||||
|
'rebase:Rebase local branches on upstream branch'
|
||||||
'smartsync:Update working tree to the latest known good revision'
|
'smartsync:Update working tree to the latest known good revision'
|
||||||
'stage:Stage file(s) for commit start:Start a new branch for development'
|
'stage:Stage file(s) for commit'
|
||||||
'start:Start a new branch for development'
|
'start:Start a new branch for development'
|
||||||
'status:Show the working tree status sync:Update working tree to the latest revision'
|
'status:Show the working tree status'
|
||||||
'sync:Update working tree to the latest revision'
|
'sync:Update working tree to the latest revision'
|
||||||
'tag-manifest:for every project in a manifest tag use the sha1 listed in the file set the tagname to it'
|
'tag-manifest:for every project in a manifest tag use the sha1 listed in the file set the tagname to it'
|
||||||
'upload:Upload changes for code review'
|
'upload:Upload changes for code review'
|
||||||
|
|
@ -105,6 +122,18 @@ _repo()
|
||||||
':projects:__repo_projects_or_all' \
|
':projects:__repo_projects_or_all' \
|
||||||
&& ret=0
|
&& ret=0
|
||||||
;;
|
;;
|
||||||
|
(rebase)
|
||||||
|
_arguments : \
|
||||||
|
"(-h --help)"{-h,--help}"[Show help]" \
|
||||||
|
"(-i --interactive)"{-i,--interactive}"[interactive rebase (single project only)]: :__repo_projects" \
|
||||||
|
"(-f --force-rebase)"{-f,--force-rebase}"[Pass --force-rebase to git rebase]" \
|
||||||
|
"(--no-ff)--no-ff=[Pass --no-ff to git rebase]"\
|
||||||
|
"(-q --quiet)"{-q,--quiet}"[Pass --quiet to git rebase]" \
|
||||||
|
"(--autosquash)--no-ff[Pass --autosquash to git rebase]"\
|
||||||
|
"(--whitespace=)--whitespace=[Pass --whitespace to git rebase]: :__git_apply_whitespace_strategies"\
|
||||||
|
"(--auto-stash)--auto-stash[Stash local modifications before starting]"\
|
||||||
|
&& ret=0
|
||||||
|
;;
|
||||||
(checkout)
|
(checkout)
|
||||||
_arguments : \
|
_arguments : \
|
||||||
"(-h --help)"{-h,--help}"[Show help]" \
|
"(-h --help)"{-h,--help}"[Show help]" \
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
# Aliases
|
# Aliases
|
||||||
#alias r='repo'
|
alias r='repo'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue