diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2017-08-10 17:16:37 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2017-08-10 17:16:37 +0200 |
commit | e3b67a8198c852bf6c9db3a0a1a20e87a4e1da74 (patch) | |
tree | 8486633f6232f49ea330ab8e036decb5dc3bbf74 /Completion/Unix/Command/_git | |
parent | f8edeff2494bf23e2ee29d4c761361b1c878e09d (diff) | |
parent | dc475bfa0ec6cd03789dde3bf28f71e0ea9d5003 (diff) | |
download | zsh-e3b67a8198c852bf6c9db3a0a1a20e87a4e1da74.tar.gz zsh-e3b67a8198c852bf6c9db3a0a1a20e87a4e1da74.zip |
Merge tag '5.4.1' into debian
Release 5.4.1.
Diffstat (limited to 'Completion/Unix/Command/_git')
-rw-r--r-- | Completion/Unix/Command/_git | 144 |
1 files changed, 100 insertions, 44 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index b5b3e79eb..518e6d198 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -292,7 +292,7 @@ _git-branch () { declare l c m d e l='--color --no-color -r --remotes -a -v --verbose --abbrev --no-abbrev --list --points-at --sort' - c='-l --create-reflog -f --force -t --track --no-track -u --set-upstream --set-upstream-to --unset-upstream --contains --merged --no-merged' + c='-l --create-reflog -f --force -t --track --no-track -u --set-upstream --set-upstream-to --unset-upstream --contains --no-contains --merged --no-merged' m='-m --move -M' d='-d --delete -D' e='--edit-description' @@ -341,9 +341,10 @@ _git-branch () { "($l $m $d $e)--no-track[override the branch.autosetupmerge configuration variable]" \ "($l $m $d $e -u --set-upstream --set-upstream-to --unset-upstream)"{-u+,--set-upstream-to=}"[set up configuration so that pull merges]:remote-branches:__git_remote_branch_names" \ "($l $m $d $e -u --set-upstream --set-upstream-to --unset-upstream)--unset-upstream[remove upstream configuration]" \ - "($l $m $d $e)--contains=[only list branches which contain the specified commit]: :__git_committishs" \ - "($l $m $d $e)--merged=[only list branches which are fully contained by HEAD]: :__git_committishs" \ - "($l $m $d $e)--no-merged=[don't list branches which are fully contained by HEAD]: :__git_committishs" \ + "($l $m $d $e)*--contains=[only list branches that contain the specified commit]: :__git_committishs" \ + "($l $m $d $e)*--no-contains=[only list branches that don't contain the specified commit]: :__git_committishs" \ + "($l $m $d $e)--merged=[only list branches that are fully contained by HEAD]: :__git_committishs" \ + "($l $m $d $e)--no-merged=[don't list branches that are fully contained by HEAD]: :__git_committishs" \ "($c $l $m $d)--edit-description[edit branch description]" \ $dependent_creation_args \ "($l $c $d $m $e)"{-m,--move}"[rename a branch and the corresponding reflog]" \ @@ -354,6 +355,7 @@ _git-branch () { {-q,--quiet}"[be more quiet]" \ '*--sort=[specify field to sort on]: :__git_ref_sort_keys' \ '--points-at=[only list tags of the given object]: :__git_commits' \ + "($c $m $d $e -i --ignore-case)"{-i,--ignore-case}'[sorting and filtering are case-insensitive]' \ $dependent_deletion_args } @@ -460,6 +462,7 @@ _git-checkout () { '(-)'{-p,--patch}'[interactively select hunks in diff between given tree-ish and working tree]' \ "--ignore-skip-worktree-bits[don't limit pathspecs to sparse entries only]" \ "--ignore-other-worktrees[don't check if another worktree is holding the given ref]" \ + '--recurse-submodules=-[control recursive updating of submodules]::checkout:__git_commits' \ '(-q --quiet)--progress[force progress reporting]' \ '(-)--[start file arguments]' \ '*:: :->branch-or-tree-ish-or-file' && ret=0 @@ -473,32 +476,29 @@ _git-checkout () { [[ $line[CURRENT] = -* ]] && return if (( CURRENT == 1 )) && [[ -z $opt_args[(I)--] ]]; then # TODO: Allow A...B - local branch_arg='' \ + local \ remote_branch_noprefix_arg='remote-branch-names-noprefix::__git_remote_branch_names_noprefix' \ - tree_ish_arg='tree-ishs::__git_tree_ishs' \ + tree_ish_arg='tree-ishs::__git_commits_prefer_recent' \ file_arg='modified-files::__git_modified_files' if [[ -n ${opt_args[(I)-b|-B|--orphan|--detach]} ]]; then - remote_branch_noprefix_arg= - file_arg= + _alternative $tree_ish_arg && ret=0 elif [[ -n $opt_args[(I)--track] ]]; then - branch_arg='remote-branches::__git_remote_branch_names' - remote_branch_noprefix_arg= - tree_ish_arg= - file_arg= + _alternative remote-branches::__git_remote_branch_names && ret=0 elif [[ -n ${opt_args[(I)--ours|--theirs|-m|--conflict|--patch]} ]]; then - remote_branch_noprefix_arg= + _alternative $tree_ish_arg $file_arg && ret=0 + else + _alternative \ + $file_arg \ + $tree_ish_arg \ + $remote_branch_noprefix_arg \ + && ret=0 fi - _alternative \ - $branch_arg \ - $remote_branch_noprefix_arg \ - $tree_ish_arg \ - $file_arg && ret=0 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 + elif [[ -n $line[1] ]] && __git_is_treeish ${(Q)line[1]}; then + __git_ignore_line __git_tree_files ${PREFIX:-.} ${(Q)line[1]} && ret=0 else __git_ignore_line __git_modified_files && ret=0 fi @@ -628,9 +628,10 @@ _git-clone () { '*--shallow-exclude=[shallow clone excluding commits reachable from specified remote revision]:revision' \ '(--no-single-branch)--single-branch[clone only history leading up to the main branch or the one specified by -b]' \ '(--single-branch)--no-single-branch[clone history leading up to each branch]' \ + "--no-tags[don't clone any tags and make later fetches not follow them]" \ '--shallow-submodules[any cloned submodules will be shallow]' \ '--recursive[initialize all contained submodules]' \ - '--recurse-submodules[initialize submodules in the clone]' \ + '--recurse-submodules=-[initialize submodules in the clone]::file:__git_files' \ '--separate-git-dir[place .git dir outside worktree]:path to .git dir:_path_files -/' \ '(-4 --ipv4 -6 --ipv6)'{-4,--ipv4}'[use IPv4 addresses only]' \ '(-4 --ipv4 -6 --ipv6)'{-6,--ipv6}'[use IPv6 addresses only]' \ @@ -688,7 +689,7 @@ _git-commit () { '(--reset-author)--author[override the author name used in the commit]:author name' \ '--date=[override the author date used in the commit]:date' \ '(-s --signoff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \ - '(-n --no-verify)'{-n,--no-verify}'[do not look for suspicious lines the commit introduces]' \ + '(-n --no-verify)'{-n,--no-verify}'[bypass pre-commit and commit-msg hooks]' \ '--allow-empty[allow recording an empty commit]' \ '--allow-empty-message[allow recording a commit with an empty message]' \ '--cleanup=[specify how the commit message should be cleaned up]:mode:((verbatim\:"do not change the commit message at all" @@ -726,6 +727,7 @@ _git-commit () { _git-describe () { _arguments -S -s \ '(*)--dirty=-[describe HEAD, adding mark if dirty]::mark' \ + '(*)--broken=-[describe HEAD, adding mark if broken]::mark' \ '--all[use any ref found in "$GIT_DIR/refs/"]' \ '--tags[use any ref found in "$GIT_DIR/refs/tags"]' \ '(--tags)--contains[find the tag after the commit instead of before]' \ @@ -734,7 +736,8 @@ _git-describe () { '(--candidates )--exact-match[only output exact matches, same as --candidates=0]' \ '--debug[display information about the searching strategy]' \ '(--abbrev)--long[always show full format, even for exact matches]' \ - '--match=[only consider tags matching glob pattern]:pattern' \ + '*--match=[only consider tags matching glob pattern]:pattern' \ + "*--exclude=[don't consider tags matching glob pattern]:pattern" \ '--always[show uniquely abbreviated commit object as fallback]' \ '--first-parent[follow only the first parent of merge commits]' \ '*: :__git_committishs' @@ -754,7 +757,8 @@ _git-diff () { $diff_options \ '(--exit-code)--quiet[disable all output]' \ $diff_stage_options \ - '(--cached --staged)'{--cached,--staged}'[show diff between index and named commit]' \ + '(--cached --staged)--no-index[show diff between two paths on the filesystem]' \ + '(--cached --staged --no-index)'{--cached,--staged}'[show diff between index and named commit]' \ '(-)--[start file arguments]' \ '*:: :->from-to-file' && ret=0 @@ -772,6 +776,12 @@ _git-diff () { return ret fi + # If "--no-index" was given, only file paths need to be completed. + if [[ -n ${opt_args[(I)--no-index]} ]]; then + _alternative 'files::_files' && ret=0 + return ret + fi + # Otherwise, more complex conditions need to be checked. case $CURRENT in (1) @@ -965,6 +975,8 @@ _git-grep () { '(--cached)--no-index[search files in current directory, not just tracked files]' \ '(--exclude-standard)--no-exclude-standard[search also in ignored files]' \ '(--no-exclude-standard)--exclude-standard[exclude files standard ignore mechanisms]' \ + '--recurse-submodules[recursively search in each submodule]' \ + "--parent-basename=[prepend parent project's basename to output]:basename" \ '--untracked[search also in untracked files]' \ '(-a --text)'{-a,--text}'[process binary files as if they were text]' \ '(--textconv --no-textconv)--textconv[honor textconv filter settings]' \ @@ -1001,7 +1013,7 @@ _git-grep () { '(1)*-e+[use the given pattern for matching]:pattern' \ $pattern_operators \ '--all-match[all patterns must match]' \ - ':pattern' \ + ': :_guard "^-*" pattern' \ '*:: :->tree-or-file' && ret=0 # TODO: If --cached, --no-index, -O, or --open-files-in-pager was given, @@ -1175,6 +1187,7 @@ _git-merge () { '( --no-rerere-autoupdate)--rerere-autoupdate[allow the rerere mechanism to update the index]' \ '(--rerere-autoupdate )--no-rerere-autoupdate[do not allow the rerere mechanism to update the index]' \ '--abort[restore the original branch and abort the merge operation]' \ + '--continue[continue the current in-progress merge]' \ '--progress[force progress reporting]' \ '*: : __git_commits -O expl:git_commit_opts' } @@ -1355,6 +1368,7 @@ _git-push () { '--recurse-submodules=[submodule handling]:submodule handling:(( check\:"refuse to push if submodule commit not to be found on remote" on-demand\:"push all changed submodules" + only\:"submodules will be recursively pushed while the superproject is left unpushed" no\:"no submodule handling"))' \ "(--no-signed --signed)--sign=-[GPG sign the push]::signing enabled:(($^^sign))" \ '(--no-signed --sign)--signed[GPG sign the push]' \ @@ -1396,6 +1410,7 @@ _git-rebase () { '(-)--abort[abort current rebase]' \ '(-)--edit-todo[edit interactive instruction sheet in an editor]' \ '(-)--skip[skip the current patch]' \ + '(-)--quit[abort but keep HEAD where it is]' \ - options \ '(-m --merge)'{-m,--merge}'[use merging strategies to rebase]' \ '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=-}'[GPG-sign the commit]::key id' \ @@ -1421,6 +1436,7 @@ _git-rebase () { '(--autostash --no-autostash)--no-autostash[do not stash uncommitted changes before rebasing and apply them afterwards]' \ '--fork-point[use merge-base --fork-point to refine upstream]' \ '--ignore-date[use current timestamp for author date]' \ + '--signoff[add Signed-off-by: line to the commit message]' \ '--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' \ @@ -1439,6 +1455,7 @@ _git-reset () { '(--soft --mixed --merge --keep -p --patch -- *)--hard[match the working tree and index to the given tree]' \ '(--soft --mixed --hard --keep -p --patch -- *)--merge[reset out of a conflicted merge]' \ '(--soft --mixed --hard --merge -p --patch -- *)--keep[like --hard, but keep local working tree changes]' \ + '--recurse-submodules=-[control recursive updating of submodules]::reset:__git_commits' \ '(-p --patch)'{-p,--patch}'[select diff hunks to remove from the index]' \ '(-q --quiet)'{-q,--quiet}'[suppress all output]' \ '(--soft --mixed --hard --merge --keep):: :__git_commits' \ @@ -1447,6 +1464,12 @@ _git-reset () { case $state in (file) local tree=HEAD + if zstyle -t :completion:${curcontext}: verbose; then + if ! tree=$(_call_program headed git rev-parse --verify HEAD); then + # well-known sha1 of the empty tree + tree=4b825dc642cb6eb9a060e54bf8d69288fbee4904 + fi + fi if [[ -n $line[1] ]] && __git_is_treeish $line[1]; then tree=$line[1] fi @@ -1606,6 +1629,7 @@ _git-stash () { _arguments -C \ '*::: :->args' \ + '(-m --message)'{-m,--message}'[specify stash description]' \ ${save_arguments//#\(/(* } && ret=0 if [[ -n $state ]]; then @@ -1613,7 +1637,7 @@ _git-stash () { local -a commands commands=( - save:'save your local modifications to a new stash' + {push,save}:'save your local modifications to a new stash' list:'list the stashes that you currently have' show:'show the changes recorded in the stash as a diff' pop:'remove and apply a single stashed state from the stash list' @@ -1635,6 +1659,12 @@ _git-stash () { $save_arguments \ ':: :_guard "([^-]?#|)" message' && ret=0 ;; + (push) + _arguments -S \ + $save_arguments \ + '(-m --message)'{-m,--message}'[specify stash description]' \ + ':: :__git_modified_files' && ret=0 + ;; (list) local -a log_options revision_options __git_setup_log_options @@ -1693,9 +1723,10 @@ _git-status () { fi _arguments -S -s \ - '(-s --short --column --no-column)'{-s,--short}'[output in short format]' \ + '(-s --short --column --no-column --show-stash)'{-s,--short}'[output in short format]' \ $branch_opts \ '(-s --short)--porcelain=-[produce machine-readable output]:version:(v1)' \ + '(-s --short)--show-stash[show stash information]' \ '(-u --untracked-files)'{-u-,--untracked-files=-}'[show untracked files]::mode:((no\:"show no untracked files" \ normal\:"show untracked files and directories" \ all\:"also show untracked files in untracked directories (default)"))' \ @@ -1729,6 +1760,7 @@ _git-submodule () { update:'update a submodule' summary:'show commit summary between given commit and working tree/index' foreach:'evaluate shell command in each checked-out submodule' + absorbgitdirs:'move the git directory of a submodule into its superprojects' sync:'synchronize submodule settings') _describe -t commands command commands && ret=0 @@ -1817,8 +1849,13 @@ _git-submodule () { '(-q --quiet)'{-q,--quiet}'[suppress all output]' \ '*: :__git_ignore_line_inside_arguments __git_submodules' && ret=0 ;; + (absorbgitdirs) + _arguments -S \ + '(-q --quiet)'{-q,--quiet}'[suppress all output]' \ + '*:path:_directories' + ;; (*) - _nothing + _default ;; esac ;; @@ -1947,14 +1984,16 @@ _git-tag () { '(-l --list)'{-l,--list}'[list tags matching pattern]' \ '(--no-column)--column=-[display tag listing in columns]::column.tag option:((always\:"always show in columns" never\:"never show in columns" auto\:"show in columns if the output is to the terminal" column\:"fill columns before rows (default)" row\:"fill rows before columns" plain\:"show in one column" dense\:"make unequal size columns to utilize more space" nodense\:"make equal size columns"))' \ '(--column)--no-column[do not display in columns]' \ - '--contains=[only list tags which contain the specified commit]: :__git_commits' \ + '*--contains=[only list tags that contain the specified commit]: :__git_commits' \ + "*--no-contains=[only list tags that don't contain the specified commit]: :__git_commits" \ '--merged=-[print only tags that are merged]:: :__git_commits' \ '--no-merged=-[print only tags that are not merged]:: :__git_commits' \ '--sort=[specify how the tags should be sorted]:mode:((refname\:"lexicographic order" version\\\:refname\:"tag names are treated as version numbers"))' \ '--points-at=[only list tags of the given object]: :__git_commits' \ - '--format=[specify format to use for the output]' \ - '::pattern' \ + '--format=[specify format to use for the output]:format' \ + '(-i --ignore-case)'{-i,--ignore-case}'[sorting and filtering are case-insensitive]' \ + ':: :_guard "^-*" pattern' \ - verification \ '(-v --verify)'{-v,--verify}'[verify gpg signutare of tags]' \ '*:: :__git_ignore_line_inside_arguments __git_tags' @@ -3336,6 +3375,7 @@ _git-filter-branch () { # such. # TODO: * should be git-rev-arg and git-rev-list arguments. _arguments -S -A '-*' \ + '--setup[specify one time setup command]: :_cmdstring' \ '--env-filter[filter for modifying environment in which commit will be performed]: :_cmdstring' \ '--tree-filter[filter for rewriting tree and its contents]: :_cmdstring' \ '--index-filter[filter for rewriting index]: :_cmdstring' \ @@ -3607,6 +3647,7 @@ _git-repack () { '--window=[number of objects to consider when doing delta compression]:number of objects' \ '--window-memory=[scale window size dynamically to not use more than specified amount of memory]: : __git_guard_bytes' \ '--depth=[maximum delta depth]:maximum delta depth' \ + '--threads=[limit maximum number of threads]:threads' \ '--max-pack-size=-[maximum size of each output packfile]: : __git_guard_bytes "maximum pack size"' \ '--pack-kept-objects[repack objects in packs marked with .keep]' } @@ -3661,7 +3702,6 @@ _git-blame () { '-s[suppress author name and timestamp]' \ '-w[ignore whitespace when finding lines]' \ '--indent-heuristic[use indent-based heuristic to improve diffs]' \ - '--compaction-heuristic[use blank-line-based heuristic to improve diffs]' \ $revision_options \ ':: :__git_revisions' \ ': :__git_cached_files' && ret=0 @@ -3714,7 +3754,8 @@ _git-difftool () { '--tool-help[print a list of diff tools that may be used with --tool]' \ '(--symlinks)--no-symlinks[make copies of instead of symlinks to the working tree]' \ '(---no-symlinks)--symlinks[make symlinks to instead of copies of the working tree]' \ - '(-g --gui)'{-g,--gui}'[use diff.guitool instead of diff.tool]' + '(-g --gui)'{-g,--gui}'[use diff.guitool instead of diff.tool]' \ + '--trust-exit-code[make git-difftool exit when diff tool returns a non-zero exit code]' } (( $+functions[_git-fsck] )) || @@ -3949,6 +3990,7 @@ _git-verify-tag () { _arguments -S -s \ '(-v --verbose)'{-v,--verbose}'[print contents of the tag object before validating it]' \ '--raw[print raw gpg status output]' \ + '--format=[specify format to use for the output]:format' \ '*: :__git_tags' } @@ -4661,6 +4703,8 @@ _git-read-tree () { $exclude_per_directory_opt \ '--index-output=[write index in the named file instead of $GIT_INDEX_FILE]: :_files' \ '--no-sparse-checkout[display sparse checkout support]' \ + '--debug-unpack[debug unpack-trees]' \ + '--recurse-submodules=-[control recursive updating of submodules]::checkout:__git_commits' \ '--empty[instead of reading tree object(s) into the index, just empty it]' \ '1:first tree-ish to be read/merged:__git_tree_ishs' \ '2::second tree-ish to be read/merged:__git_tree_ishs' \ @@ -4875,7 +4919,9 @@ _git-for-each-ref () { '*--points-at=[print only refs which point at the given object]:object:__git_commits' \ '*--merged=[print only refs that are merged]:object:__git_commits' \ '*--no-merged=[print only refs that are not merged]:object:__git_commits' \ - '*--contains=[print only refs which contain the commit]:object:__git_commits' \ + '*--contains=[print only refs that contain specified commit]:object:__git_commits' \ + "*--no-contains=[print only refs that don't contain specified commit]:object:__git_commits" \ + '--ignore-case[sorting and filtering are case-insensitive]' \ '(-s --shell -p --perl --python --tcl)'{-s,--shell}'[use string literals suitable for sh]' \ '(-s --shell -p --perl --python --tcl)'{-p,--perl}'[use string literals suitable for Perl]' \ '(-s --shell -p --perl --tcl)'--python'[use string literals suitable for Python]' \ @@ -4980,7 +5026,9 @@ _git-merge-base () { _git-name-rev () { _arguments -S \ '--tags[only use tags to name commits]' \ - '--refs=[only use refs matching given pattern]: :_guard "?#" "shell pattern"' \ + '*--refs=[only use refs matching given pattern]: :_guard "?#" "shell pattern"' \ + '--no-refs[clear any previous ref patterns given]' \ + '*--exclude=[ignore refs matching specified pattern]:pattern' \ '(--stdin :)--all[list all commits reachable from all refs]' \ '(--all :)--stdin[read from stdin and append revision-name]' \ '--name-only[display only name of commits]' \ @@ -5159,6 +5207,7 @@ _git-send-pack () { "(--no-signed --signed)--sign=-[GPG sign the push]::signing enabled:(($^^sign))" \ '(--no-signed --sign)--signed[GPG sign the push]' \ "(--sign --signed)--no-signed[don't GPG sign the push]" \ + '--push-option=[specify option to transmit]:option' \ '--progress[force progress reporting]' \ '--thin[send a thin pack]' \ '--atomic[request atomic transaction on remote side]' \ @@ -5294,7 +5343,7 @@ _git-check-attr () { {-a,--all}'[list all attributes that are associated with the specified paths]' \ '--stdin[read file names from stdin instead of from command line]' \ '--cached[consider .gitattributes in the index only, ignoring the working tree.]' \ - '-z[make output format machine-parseable and treat input-paths as NUL-separated with --stdin]' \ + '-z[terminate input and output records by a NUL character]' \ $z_opt \ '(-)--[interpret preceding arguments as attributes and following arguments as path names]' \ '*:: :->attribute-or-file' && ret=0 @@ -5477,7 +5526,7 @@ __git_describe_branch () { shift 3 integer maxverbose - if zstyle -s :completion:$curcontext max-verbose maxverbose && + if zstyle -s :completion:$curcontext: max-verbose maxverbose && (( ${compstate[nmatches]} <= maxverbose )); then local __c local -a __commits @@ -6114,12 +6163,13 @@ __git_recent_branches__names() # 2. Extracts the move-source from each # 3. Eliminates duplicates # 4. Eliminates commit hashes (leaving only ref names) + # [This step is done again by the caller.] # # See workers/38592 for an equivalent long-hand implementation, and the rest # of that thread for why this implementation was chosen instead. # # Note: since we obtain the "from" part of the reflog, we only obtain heads, not tags. - reply=(${${(u)${${(0)"$(_call_program reflog git reflog -1000 -z --grep-reflog='\^checkout:\ moving\ from\ ' --pretty='%gs')"}#checkout: moving from }%% *}:#[[:xdigit:]](#c40)}) + reply=(${${(u)${${(M)${(0)"$(_call_program reflog git reflog -1000 -z --pretty='%gs')"}:#(#s)checkout: moving from *}#checkout: moving from }%% *}:#[0-9a-f](#c40)}) } (( $+functions[__git_recent_branches] )) || @@ -6156,6 +6206,10 @@ __git_recent_branches() { _describe -V -t recent-branches "recent branches" branches_colon_descriptions } +(( $+functions[__git_commits_prefer_recent] )) || +__git_commits_prefer_recent () { + _alternative 'recent-branches::__git_recent_branches' 'commits::__git_commits' +} (( $+functions[__git_commits] )) || __git_commits () { @@ -6309,11 +6363,11 @@ __git_recent_commits () { ret=1 # Resetting expl to avoid it 'leaking' from one line to the next. expl=() + _describe -V -t commits 'recent commit object name' descr && ret=0 + expl=() _wanted commit-tags expl 'commit tag' compadd "$@" -a - tags && ret=0 expl=() _wanted heads expl 'head' compadd "$@" -a - heads && ret=0 - expl=() - _describe -V -t commits 'recent commit object name' descr && ret=0 return $ret } @@ -6484,9 +6538,10 @@ __git_references () { _git_refs_cache_pwd=$PWD fi - _wanted references expl 'reference' compadd -a - _git_refs_cache + _wanted references expl 'reference' compadd -M 'r:|/=**' -a - _git_refs_cache } +# ### currently unused; are some callers of __git_references supposed to call this function? (( $+functions[__git_local_references] )) || __git_local_references () { local expl @@ -6497,7 +6552,7 @@ __git_local_references () { _git_local_refs_cache_pwd=$PWD fi - _wanted references expl 'reference' compadd -a - _git_local_refs_cache + _wanted references expl 'reference' compadd -M 'r:|/=**' -a - _git_local_refs_cache } (( $+functions[__git_remote_references] )) || @@ -6864,7 +6919,8 @@ __git_setup_diff_options () { $diff_types'--name-only[show only names of changed files]' $diff_types'--name-status[show only names and status of changed files]' '--submodule=-[select output format for submodule differences]::format:((short\:"show pairs of commit names" - log\:"list commits like git submodule does"))' + log\:"list commits like git submodule does" + diff\:"show differences"))' '( --no-color --color-words)--color=-[show colored diff]:: :__git_color_whens' '(--color --color-words)--no-color[turn off colored diff]' '--word-diff=-[show word diff]::mode:((color\:"highlight changed words using color" @@ -6908,7 +6964,7 @@ __git_setup_diff_options () { '(--no-prefix)--dst-prefix=[use given prefix for destination]:prefix' '(--src-prefix --dst-prefix)--no-prefix[do not show any source or destination prefix]' - '(-c,--cc)'{-c,--cc}'[combined diff format for merge commits]' + '(-c --cc)'{-c,--cc}'[combined diff format for merge commits]' # TODO: --output is undocumented. '--output[undocumented]:undocumented') |