diff options
| author | m0viefreak <m0viefreak.cm@googlemail.com> | 2014-02-17 05:00:39 +0100 |
|---|---|---|
| committer | Frank Terbeck <ft@bewatermyfriend.org> | 2014-02-18 12:22:21 +0100 |
| commit | b97808fba223fd68810ee6ee779e2eb3703724a3 (patch) | |
| tree | 72a3b49c9f3c9ff6011b537c9296ad0a1ba6dba6 /Completion/Unix/Command/_git | |
| parent | 32397: _git: fix __git_submodules to only use the actual name of the submodule (diff) | |
| download | zsh-b97808fba223fd68810ee6ee779e2eb3703724a3.tar zsh-b97808fba223fd68810ee6ee779e2eb3703724a3.tar.gz zsh-b97808fba223fd68810ee6ee779e2eb3703724a3.tar.bz2 zsh-b97808fba223fd68810ee6ee779e2eb3703724a3.tar.lz zsh-b97808fba223fd68810ee6ee779e2eb3703724a3.tar.xz zsh-b97808fba223fd68810ee6ee779e2eb3703724a3.tar.zst zsh-b97808fba223fd68810ee6ee779e2eb3703724a3.zip | |
32398: _git: completion updates up to latest git v1.9.0
- cherry-pick: allow commit ranges to be specified
- push: option is called --set-upstream and not --set-upstream-to
- status: offer -b,--branch when --porcelain or -z are given
--porcelain and -z don't show the branch info by default, so it
is needed to offer --branch for those options, too.
- checkout: add '--detach' option
- checkout: offer '-l' option when '--orphan' was given
- show-ref: update wording of --head and --heads according to man-page
- config: update default value for color.ui
color-bool was changed to accept a default value as $parts[5]
- add support for 'cygstart' as a valid builtin browser on cygwin
- rebase: add suuport for --autostash and config.autostash
- update builtin browser list
- grep: add --{no,}textconv
- check-ignore: add --no-index
- update-ref: add --stdin -z
- add -C
- pull: add support for --rebase=preserve
- config: add support for http.*. options
- blame: -L can be given multiple times
- config: add support for http.savecookies
- push: add support for --force-with-lease
- diff: --diff-filter: allow lower-case variants (all-but ... specs)
- config: add support for 'fetch.prune' and 'remote.*.prune'
- check-ignore: -z: update message, check-attr: add -z
- config: add diff.orderfile
- revision options: add --exclude
- revision options: add --ignore-missing
- revision options: add --bisect
- rev-parse: add --stuck-long
- merge-base: add --fork-point
- config: implement submodule.*.update completion
- send-email: add --smtp-ssl-cert-path and config options
Diffstat (limited to 'Completion/Unix/Command/_git')
| -rw-r--r-- | Completion/Unix/Command/_git | 163 |
1 files changed, 131 insertions, 32 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index a8a8786e1..a2cbf74d0 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -405,8 +405,9 @@ _git-check-ignore () { '(-q --quiet)'{-q,--quiet}'[do not output anything, just set exit status]' \ '(-v --verbose)'{-v,--verbose}'[output details about the matching pattern (if any) for each pathname]' \ '--stdin[read file names from stdin instead of from the command-line]' \ - '-z[make output format machine-parseable]' \ + '-z[make output format machine-parseable and treat input-paths as NUL-separated with --stdin]' \ '(-n --non-matching)'{-n,--non-matching}'[show given paths which do not match any pattern]' \ + '--no-index[do not look in the index when undertaking the checks]' \ '*:: :->file' && ret=0 } @@ -422,7 +423,7 @@ _git-checkout () { # and perhaps also allow all that just with ^{tree} and so on. Not quite sure # how to do that, though. local new_branch_reflog_opt - if (( words[(I)-b|-B] )); then + if (( words[(I)-b|-B|--orphan] )); then new_branch_reflog_opt="(--patch)-l[create the new branch's reflog]" fi @@ -434,12 +435,13 @@ _git-checkout () { '(-f --force -m --merge --conflict --patch)'{-f,--force}'[force branch switch/ignore unmerged entries]' \ '(-q --quiet --theirs --patch)--ours[check out stage #2 for unmerged paths]' \ '(-q --quiet --ours --patch)--theirs[check out stage #3 for unmerged paths]' \ - '( -B --orphan --ours --theirs --conflict --patch)-b[create a new branch based at given commit]: :__git_branch_names' \ - '(-b --orphan --ours --theirs --conflict --patch)-B[create or update branch based at given commit]: :__git_branch_names' \ - '(-t --track --orphan --patch)'{-t,--track}'[set up configuration so pull merges from the base commit]' \ + '( -B --orphan --ours --theirs --conflict --patch --detach)-b[create a new branch based at given commit]: :__git_branch_names' \ + '(-b --orphan --ours --theirs --conflict --patch --detach)-B[create or update branch based at given commit]: :__git_branch_names' \ + '(-t --track --orphan --patch --detach)'{-t,--track}'[set up configuration so pull merges from the base commit]' \ '(--patch)--no-track[override the branch.autosetupmerge configuration variable]' \ $new_branch_reflog_opt \ - '(-b -B -t --track --patch)--orphan[create a new orphan branch based at given commit]: :__git_branch_names' \ + '(-b -B -t --track --patch --orphan)--detach[detach the HEAD at named commit]' \ + '(-b -B -t --track --patch --detach)--orphan[create a new orphan branch based at given commit]: :__git_branch_names' \ '--ignore-skip-worktree-bits[ignores patterns and adds back any files in <paths>]' \ '(-q --quiet -f --force -m --merge --conflict --patch)'{-m,--merge}'[3way merge current branch, working tree and new branch]' \ '(-q --quiet -f --force -m --merge --patch)--conflict[same as --merge, using given merge style]:style:(merge diff3)' \ @@ -461,7 +463,7 @@ _git-checkout () { tree_ish_arg='tree-ishs::__git_tree_ishs' \ file_arg='modified-files::__git_modified_files' - if [[ -n ${opt_args[(I)-b|-B|--orphan]} ]]; then + if [[ -n ${opt_args[(I)-b|-B|--orphan|--detach]} ]]; then remote_branch_noprefix_arg= tree_ish_arg= file_arg= @@ -480,7 +482,7 @@ _git-checkout () { $remote_branch_noprefix_arg \ $tree_ish_arg \ $file_arg && ret=0 - elif [[ -n ${opt_args[(I)-b|-B|-t|--track|--orphan]} ]]; then + elif [[ -n ${opt_args[(I)-b|-B|-t|--track|--orphan|--detach]} ]]; then _nothing elif [[ -n $line[1] ]] && __git_is_treeish $line[1]; then __git_ignore_line __git_tree_files ${PREFIX:-.} $line[1] && ret=0 @@ -509,7 +511,7 @@ _git-cherry-pick () { '*'{-s,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' \ '*'{-X,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]' \ '(-e --edit -x -n --no-commit -s --signoff)--ff[fast forward, if possible]' \ - ': :__git_revisions' + ': :__git_commit_ranges' } (( $+functions[_git-citool] )) || @@ -922,6 +924,8 @@ _git-grep () { '(--no-exclude-standard)--exclude-standard[exclude files standard ignore mechanisms]' \ '--untracked[search in untracked files]' \ '(-a --text)'{-a,--text}'[process binary files as if they were text]' \ + '(--textconv --no-textconv)--textconv[honor textconv filter settings]' \ + '(--textconv --no-textconv}--no-textconv[do not honor textconv filter settings]' \ '(-i --ignore-case)'{-i,--ignore-case}'[ignore case when matching]' \ '-I[do not match pattern in binary files]' \ '--max-depth=[descend at most given levels of directories]: :__git_guard_number depth' \ @@ -1241,8 +1245,10 @@ _git-pull () { _arguments \ $merge_options \ - '( --no-rebase)--rebase[perform a rebase after fetching]' \ - '(--rebase )--no-rebase[do not perform a rebase after fetching]' \ + '(-r --rebase --no-rebase)'{-r=-,--rebase=-}'[perform a rebase after fetching]::rebase after fetching:((true\:"rebase after fetching" + false\:"merge after fetching" + preserve\:"rebase and preserve merges"))' \ + '(-r --rebase )--no-rebase[do not perform a rebase after fetching]' \ $fetch_options \ ': :__git_any_repositories' \ '*: :__git_ref_specs' @@ -1250,6 +1256,7 @@ _git-pull () { (( $+functions[_git-push] )) || _git-push () { + local ret=1 # NOTE: For --receive-pack we use _files to complete, even though this will # only complete files on the local end, not the remote end. Still, it may be # helpful to get some sort of completion going, perhaps modifying the path @@ -1264,9 +1271,11 @@ _git-push () { '--tags[all tags under refs/tags are pushed]' \ '--follow-tags[also push missing annotated tags reachable from the pushed refs]' \ '(--receive-pack --exec)'{--receive-pack=-,--exec=-}'[path to git-receive-pack on remote]:remote git-receive-pack:_files' \ + '(--force-with-lease --no-force-with-lease)*--force-with-lease=-[allow refs that are not ancestors to be updated if current ref matches expected value]::ref and expectation:->lease' \ + '(--force-with-lease --no-force-with-lease)--no-force-with-lease=-[cancel all previous force-with-lease specifications]' \ '(-f --force)'{-f,--force}'[allow refs that are not ancestors to be updated]' \ '(:)--repo=[default repository to use]:repository:__git_any_repositories' \ - '(-u --set-upstream-to)'{-u,--set-upstream-to}'[add upstream reference for each branch that is up to date or pushed]' \ + '(-u --set-upstream)'{-u,--set-upstream}'[add upstream reference for each branch that is up to date or pushed]' \ '( --no-thin)--thin[try to minimize number of objects to be sent]' \ '(--thin )--no-thin[do not try to minimize number of objects to be sent]' \ '(-q --quiet -v --verbose --progress)'{-q,--quiet}'[suppress all output]' \ @@ -1276,7 +1285,20 @@ _git-push () { '--recurse-submodules=[submodule handling]:submodule handling:((check\:"refuse pushing of supermodule if submodule commit cannot be found on the remote" on-demand\:"push all changed submodules"))' \ ':: :__git_any_repositories' \ - '*: :__git_ref_specs' + '*: :__git_ref_specs' && ret=0 + + case $state in + (lease) + compset -P '*:' + if [[ -n ${IPREFIX#*=} ]]; then + _guard '[[:xdigit:]]#' "expected value" && ret=0 + else + __git_remote_branch_names_noprefix && ret=0 + fi + ;; + esac + + return ret } (( $+functions[_git-rebase] )) || @@ -1311,6 +1333,8 @@ _git-rebase () { {-x,--exec}'[with -i\: append "exec <cmd>" after each line]:command' \ '(1)--root[rebase all reachable commits]' \ $autosquash_opts \ + '(--autostash --no-autostash)--autostash[stash uncommitted changes before rebasing and apply them afterwards]' \ + '(--autostash --no-autostash)--no-autostash[do not stash uncommitted changes before rebasing and apply them afterwards]' \ '--no-ff[cherry-pick all rebased commits with --interactive, otherwise synonymous to --force-rebase]' \ '--onto[start new branch with HEAD equal to given revision]:newbase:__git_revisions' \ ':upstream branch:__git_revisions' \ @@ -1567,7 +1591,7 @@ _git-stash () { _git-status () { local -a branch_opts - if (( $words[(I)-s|--short] )); then + if (( $words[(I)-s|--short|--porcelain|-z] )); then branch_opts=('(-b --branch)'{-b,--branch}'[show branch and tracking info]') fi @@ -1900,13 +1924,13 @@ _git-config () { 'browser.*.cmd:browser command to use:browser:_path_commands' 'browser.*.path:path to use for the browser:absolute browser path:_files -g "*(*)"' clean.requireForce:'require --force for git clean to actually do something::->bool:true' - color.branch:'color output of git branch::->color-bool' + color.branch:'color output of git branch::->color-bool:false' color.branch.current:'color of the current branch::->color' color.branch.local:'color of a local branch::->color' color.branch.remote:'color of a remote branch::->color' color.branch.upstream:'color of upstream branches::->color' color.branch.plain:'color of other branches::->color' - color.diff:'color output of git diff::->color-bool' + color.diff:'color output of git diff::->color-bool:false' color.diff.plain:'color of context text::->color' color.diff.meta:'color of meta-information::->color' color.diff.frag:'color of hunk headers::->color' @@ -1920,7 +1944,7 @@ _git-config () { color.decorate.tag:'color of tags::->color' color.decorate.stash:'color of stashes::->color' color.decorate.HEAD:'color of HEAD::->color' - color.grep:'whether or not to color output of git grep::->color-bool' + color.grep:'whether or not to color output of git grep::->color-bool:false' color.grep.context:'color of non-matching text in context lines::->color' color.grep.filename:'color of filename prefix::->color' color.grep.function:'color of function name lines::->color' @@ -1928,14 +1952,14 @@ _git-config () { color.grep.match:'color of matching text::->color' color.grep.selected:'color of non-matching text in selected lines::->color' color.grep.separator:'color of separators between fields in a line::->color' - color.interactive:'whether or not to color in interactive mode::->color-bool' + color.interactive:'whether or not to color in interactive mode::->color-bool:false' color.interactive.prompt:'color of prompt::->color' color.interactive.header:'color of header::->color' color.interactive.help:'color of help::->color' color.interactive.error:'color of error::->color' color.pager:'feed colored output to pager::->bool:true' - color.showbranch:'color output of git show-branch::->color-bool' - color.status:'color output of git status::->color-bool' + color.showbranch:'color output of git show-branch::->color-bool:false' + color.status:'color output of git status::->color-bool:false' color.status.branch:'color of the current branch::->color' color.status.header:'color of header text::->color' color.status.added:'color of added, but not yet committed, files::->color' @@ -1943,7 +1967,7 @@ _git-config () { color.status.changed:'color of changed, but not yet added in the index, files::->color' color.status.untracked:'color of files not currently being tracked::->color' color.status.nobranch:'color of no-branch warning::->color' - color.ui:'color output of capable git commands::->color-bool' + color.ui:'color output of capable git commands::->color-bool:auto' commit.cleanup:'default --cleanup option::->commit.cleanup:default' commit.status:'include status information in commit message template::->bool:true' commit.template:'template file for commit messages:template:_files' @@ -1960,6 +1984,7 @@ _git-config () { diff.external:'command to generate diff with:diff command:_path_commands' diff.mnemonicprefix:'use mnemonic source and destination prefixes::->bool:false' diff.noprefix:'strip source and destination prefixes::->bool:false' + diff.orderfile:'file to read patch order glob patterns from:order file:_files' diff.renameLimit:'number of files to consider when detecting copy/renames:rename limit:->int' diff.renames:'try to detect renames::->diff.renames:true' diff.ignoreSubmodules:'ignore submodules::->bool:false' @@ -1972,6 +1997,7 @@ _git-config () { difftool.prompt:'prompt before each invocation of the diff tool::->bool:true' diff.wordRegex:'regex used to determine what a word is when performing word-by-word diff:regular expression:->string' diff.guitool:'diff tool with gui to use::__git_difftools' + fetch.prune:'remove any remote tracking branches that no longer exist remotely::->bool:false' fetch.unpackLimit:'maximum number of objects to unpack when fetching:unpack limit:->int' fetch.recurseSubmodules:'recurse into submodules (as needed) when fetching::->fetch.recurseSubmodules:on-demand' fetch.fsckObjects:'check all fetched objects::->bool:false' @@ -2054,13 +2080,14 @@ _git-config () { grep.lineNumber:'enable -n option by default::->bool:false' grep.patternType:'default matching pattern type::->grep.patternType:default' help.browser:'browser used to display help in web format::__git_browsers' - http.cookiefile:'file containing cookie lines which should be used in the Git http session::_files' help.htmlpath:'location of HTML help::->help.htmlpath' + http.cookiefile:'file containing cookie lines which should be used in the Git http session::_files' http.lowSpeedLimit:'limit controlling when to abort an HTTP transfer:speed limit:->int' http.lowSpeedTime:'limit controlling when to abort an HTTP transfer:time limit (seconds):->int' help.format:'default help format used by git help::->help.format' help.autocorrect:'execute corrected mistyped commands::->bool:false' http.proxy:'HTTP proxy to use:proxy:_urls' |
