From 4da5c23dcecde6975869dd7b08e5f9176748d12c Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 28 Jul 2016 12:25:52 +0000 Subject: 40493/0001: _git-checkout: No functional change. This makes the next diff smaller. --- Completion/Unix/Command/_git | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index b5b3e79eb..8b78b5785 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -473,28 +473,24 @@ _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' \ 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 \ + $remote_branch_noprefix_arg \ + $tree_ish_arg \ + $file_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 -- cgit v1.2.3 From 3afd12ae9716b25ef03c768b270ea91e9202364f Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 28 Jul 2016 12:37:14 +0000 Subject: 40493/0002: _git-checkout: Reorder default completions. The unprefixed name of a remote branch is used to create a new local remote-tracking branch; that is presumed to be a rarer operation than either switching among local branches or reverting to the index version of a modified file. Between the remaining two, put modified files before tree-ishes because there are generally few of the former and many of the latter. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index 94df516ba..83a27f454 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-02-07 Daniel Shahaf + + * 40493/0002: Completion/Unix/Command/_git: _git-checkout: + Reorder default completions. + 2017-02-07 Daniel Shahaf * 40493/0001: Completion/Unix/Command/_git: _git-checkout: diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 8b78b5785..b16d2bc4c 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -486,9 +486,10 @@ _git-checkout () { _alternative $tree_ish_arg $file_arg && ret=0 else _alternative \ - $remote_branch_noprefix_arg \ + $file_arg \ $tree_ish_arg \ - $file_arg && ret=0 + $remote_branch_noprefix_arg \ + && ret=0 fi elif [[ -n ${opt_args[(I)-b|-B|-t|--track|--orphan|--detach]} ]]; then -- cgit v1.2.3 From ec1bdab023543a60b2cd6f920c38bd88a4057886 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 5 Feb 2017 09:38:23 +0000 Subject: 40494: _git: Use slashes matchspec for references (as already used for branch names). --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index 83a27f454..9ad26b720 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-02-07 Daniel Shahaf + + * 40494: Completion/Unix/Command/_git: Use slashes matchspec + for references (as already used for branch names). + 2017-02-07 Daniel Shahaf * 40493/0002: Completion/Unix/Command/_git: _git-checkout: diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index b16d2bc4c..684eb21d0 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -6481,9 +6481,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 @@ -6494,7 +6495,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] )) || -- cgit v1.2.3 From 76a033e2ccf3be6a21736160654444fe26fd7d9d Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 4 Mar 2017 00:37:04 +0100 Subject: 40715: update completion of git options for git 2.12.0 --- Completion/Unix/Command/_git | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 684eb21d0..b6472cf36 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -354,6 +354,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 } @@ -685,7 +686,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" @@ -962,6 +963,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]' \ @@ -998,7 +1001,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, @@ -1172,6 +1175,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' } @@ -1352,6 +1356,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]' \ @@ -1393,6 +1398,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' \ @@ -1726,6 +1732,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 @@ -1814,8 +1821,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 ;; @@ -1950,8 +1962,9 @@ _git-tag () { '--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' @@ -3658,7 +3671,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 @@ -3711,7 +3723,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] )) || @@ -3946,6 +3959,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' } @@ -4873,6 +4887,7 @@ _git-for-each-ref () { '*--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' \ + '--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]' \ @@ -6862,7 +6877,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" -- cgit v1.2.3 From 7276d04934192c0a9e32617f0c8c42d166dbdb52 Mon Sep 17 00:00:00 2001 From: Fabian Klotzl Date: Thu, 9 Mar 2017 20:27:41 -0800 Subject: 40808: fix typos where (x,y) should have been (x y) in _arguments syntax --- ChangeLog | 8 ++++++++ Completion/Linux/Command/_mdadm | 2 +- Completion/Unix/Command/_git | 2 +- Completion/Unix/Command/_grep | 2 +- Completion/Unix/Command/_hg | 2 +- Completion/Unix/Command/_java | 2 +- Completion/Unix/Command/_ls | 2 +- Completion/Unix/Command/_mysql_utils | 2 +- Completion/Unix/Command/_rake | 2 +- Completion/Unix/Command/_user_admin | 2 +- Completion/Unix/Command/_wget | 2 +- Completion/Unix/Command/_zpool | 2 +- 12 files changed, 19 insertions(+), 11 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index ac05c545c..b440f936e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2017-03-09 Barton E. Schaefer + * Fabian Klotzl: 40808: Completion/Linux/Command/_mdadm, + Completion/Unix/Command/_git, Completion/Unix/Command/_grep, + Completion/Unix/Command/_hg, Completion/Unix/Command/_java, + Completion/Unix/Command/_ls, Completion/Unix/Command/_mysql_utils, + Completion/Unix/Command/_rake, Completion/Unix/Command/_user_admin, + Completion/Unix/Command/_wget, Completion/Unix/Command/_zpool: + fix typos where (x,y) should have been (x y) in _arguments syntax + * 40801: Completion/Unix/Command/_mount: turns out that work of art removed by 33963 was necessary after all: re-fix completion of mount points with spaces in the name diff --git a/Completion/Linux/Command/_mdadm b/Completion/Linux/Command/_mdadm index b2af3269d..b6dce7ccb 100644 --- a/Completion/Linux/Command/_mdadm +++ b/Completion/Linux/Command/_mdadm @@ -78,7 +78,7 @@ if (( $+words[(r)-(A|-assemble)] )); then '(--scan -s)'{--scan,-s}'[scan config file for missing information]' '(--run -R)'{--run,-R}'[try to start the array even if not enough devices for a full array are present]' '(--force -f)'{--force,-f}'[assemble the array even if some superblocks appear out-of-date]' - '(--update,-U)'{--update=,-U}'[update superblock]::update the superblock:(sparc2.2 summaries uuid resync byteorder super-minor)' + '(--update -U)'{--update=,-U}'[update superblock]::update the superblock:(sparc2.2 summaries uuid resync byteorder super-minor)' ) fi diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index b6472cf36..43cbc46ec 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -6922,7 +6922,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') diff --git a/Completion/Unix/Command/_grep b/Completion/Unix/Command/_grep index 5d548b567..a31cf9cf6 100644 --- a/Completion/Unix/Command/_grep +++ b/Completion/Unix/Command/_grep @@ -32,7 +32,7 @@ arguments+=( '(--after-context -A)'{--after-context=,-A+}'[specify lines of trailing context]:lines' '(--text -a --binary-files -I)'{--text,-a}'[process binary file as if it were text]' '(--before-context -B)'{--before-context=,-B+}'[specify lines of leading context]:lines' - '(--context,-C)'{--context=,-C-}'[specify lines of context]:lines' + '(--context -C)'{--context=,-C-}'[specify lines of context]:lines' '(--color --colour)--'{color,colour}'=-[distinguish matching string]::when:(always never auto)' '(--no-group-separator)--group-separator=[specify separator between blocks of context]:separator [--]' "(--group-separator)--no-group-separator[don't separate context blocks]" diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg index 8d31cd377..8eaa457c8 100644 --- a/Completion/Unix/Command/_hg +++ b/Completion/Unix/Command/_hg @@ -876,7 +876,7 @@ _hg_cmd_qdiff() { _hg_cmd_qfold() { _arguments -s : $_hg_global_opts $_h_commit_opts \ - '(--keep,-k)'{-k,--keep}'[keep folded patch files]' \ + '(--keep -k)'{-k,--keep}'[keep folded patch files]' \ '*:unapplied patch:_hg_qunapplied' } diff --git a/Completion/Unix/Command/_java b/Completion/Unix/Command/_java index 7a1224677..30231c5ee 100644 --- a/Completion/Unix/Command/_java +++ b/Completion/Unix/Command/_java @@ -65,7 +65,7 @@ java) '-D-[specify a property]:property:->property' \ \*{-enableassertions,-ea}-::class \ \*{-disableassertions,-da}-::class \ - '(-enablesystemassertions,-esa,-disablesystemassertions,-dsa)'{-enablesystemassertions,-esa,-disablesystemassertions,-dsa} \ + '(-enablesystemassertions -esa -disablesystemassertions -dsa)'{-enablesystemassertions,-esa,-disablesystemassertions,-dsa} \ '(-verbose:class)-verbose[print class information]' \ '(-verbose)-verbose\:class[print class information]' \ '-verbose\:gc[print gc information]' \ diff --git a/Completion/Unix/Command/_ls b/Completion/Unix/Command/_ls index 74f317ad1..2ca59423d 100644 --- a/Completion/Unix/Command/_ls +++ b/Completion/Unix/Command/_ls @@ -78,7 +78,7 @@ else '(--ignore-backups -B)'{--ignore-backups,-B}"[don't list entries ending with ~]" '(--directory -d)'{--directory,-d}'[list directory entries instead of contents]' '(--dired -D)'{--dired,-D}"[generate output designed for Emacs' dired mode]" - '(--ignore,-I)'{--ignore,-I}"[don't list entire matching pattern]:pattern:" + '(--ignore -I)'{--ignore,-I}"[don't list entire matching pattern]:pattern:" '(--dereference -L --dereference-command-line --dereference-command-line-symlink-to-dir)'{--dereference,-L}'[list referenced file for sym link]' '(--dereference -L --dereference-command-line --dereference-command-line-symlink-to-dir)'{--dereference-command-line,--dereference-command-line-symlink-to-dir} '(--recursive -R)'{--recursive,-R}'[list subdirectories recursively]' diff --git a/Completion/Unix/Command/_mysql_utils b/Completion/Unix/Command/_mysql_utils index 6532d0a7b..f1ad97bcd 100644 --- a/Completion/Unix/Command/_mysql_utils +++ b/Completion/Unix/Command/_mysql_utils @@ -212,7 +212,7 @@ _mysql_utils() { '--defaults-extra-file=[read specified file after the global files]:defaults file:_files' '(-S --socket)'{-S+,--socket=}'[specify socket file to use for connection]:server socket file:_files' '(-h --host)'{-h+,--host=}'[specify server hostname]:hostname:_mysql_hosts' - '(-P,--port)'{-P+,--port=}'[specify port number for connection]:server port:_mysql_ports' + '(-P --port)'{-P+,--port=}'[specify port number for connection]:server port:_mysql_ports' '(-u --user)'{-u+,--user=}'[specify username for login]:server username:_mysql_users' '(-p --password)'{-p-,--password=}'[specify password to use for connection]:server password' '(-C --compress)'{-C,--compress}'[use compression in server/client protocol]' diff --git a/Completion/Unix/Command/_rake b/Completion/Unix/Command/_rake index 7fed949ab..8814edaa5 100644 --- a/Completion/Unix/Command/_rake +++ b/Completion/Unix/Command/_rake @@ -22,7 +22,7 @@ _arguments -C -s -S \ \*{--require,-r}'[require specified module before executing rakefile]:library:->library' \ '(- *)--rules[trace the rules resolution]' \ '(--quiet -q --silent -s --verbose -v)'{--silent,-s}"[like --quiet, but also suppresses the 'in directory' announcement]" \ - '(--system,-g)'{--system,-g}'[using system wide (global) rakefiles (usually '~/.rake/*.rake')]' \ + '(--system -g)'{--system,-g}'[using system wide (global) rakefiles (usually '~/.rake/*.rake')]' \ '(- *)'{--tasks,-T}'[display the tasks (matching the specified pattern) with descriptions, then exit]:pattern::' \ '(--trace -t)'{--trace,-t}'[turn on invoke/execute tracing, enable full backtrace]' \ '(--quiet -q --silent -s --verbose -v)'{--verbose,-v}'[log message to standard output (default)]' \ diff --git a/Completion/Unix/Command/_user_admin b/Completion/Unix/Command/_user_admin index f0777729c..7eeec7e9b 100644 --- a/Completion/Unix/Command/_user_admin +++ b/Completion/Unix/Command/_user_admin @@ -125,7 +125,7 @@ case ${service%???}:${(M)service%???}:$OSTYPE in ;| group:*) args+=( - '(-g,--gid)'{-g+,--gid=}'[specify gid]:gid' + '(-g --gid)'{-g+,--gid=}'[specify gid]:gid' '(-o --non-unique)'{-o,--non-unique}'[allow non unique gid]' ) ;| diff --git a/Completion/Unix/Command/_wget b/Completion/Unix/Command/_wget index b89f12353..8a9cc871a 100644 --- a/Completion/Unix/Command/_wget +++ b/Completion/Unix/Command/_wget @@ -32,7 +32,7 @@ _arguments -C -s \ '(--timeout -T)--dns-timeout=[set the DNS lookup timeout]:DNS lookup timeout (seconds)' \ '(--timeout -T)--connect-timeout=[set the connect timeout]:connect timeout (seconds)' \ '(--timeout -T)--read-timeout=[set the read timeout]:read timeout (seconds)' \ - '(--wait,-w)'{--wait=,-w+}'[specify wait between retrievals]:time (seconds)' \ + '(--wait -w)'{--wait=,-w+}'[specify wait between retrievals]:time (seconds)' \ '(--random-wait)--waitretry=:time (seconds)' \ '(--waitretry)--random-wait[random wait time between retrievals]' \ '(--proxy -Y --no-proxy)'{--proxy=,-Y+}'[explicitly turn on proxy]' \ diff --git a/Completion/Unix/Command/_zpool b/Completion/Unix/Command/_zpool index 950266896..4d4793eea 100644 --- a/Completion/Unix/Command/_zpool +++ b/Completion/Unix/Command/_zpool @@ -237,7 +237,7 @@ _zpool() { _arguments -A "-*" \ '-D[Destroyed pools]' \ '(-d)*-c[Use cache file]:cache file:_files' \ - '(-c,-D)*-d[Search for devices or files in directory]:directory:_files -/' \ + '(-c -D)*-d[Search for devices or files in directory]:directory:_files -/' \ '-F[Recovery mode: discard transactions if required]' \ '-f[Force import]' \ '-l[Display configuration in /dev/chassis location form]' \ -- cgit v1.2.3 From 46233c40204756df3a927cab3b429df54f8e3d8c Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 10 Mar 2017 09:05:16 +0000 Subject: 40817: __git_recent_branches: Retrieve less data, but faster. By replacing the --grep-reflog=needle argument with a ${(M)...:#needle} filter, we retrieve less data from the reflog, and consequently run (on my test cases) 16% to 40% faster. The trade-off is that we retrieve less data: instead of retrieving the 1000 most recent 'checkout' operations, we retrieve the most recent 1000 operations, which would include fewer than 1000 checkout operations. Also change [[:xdigit:]] to [0-9a-f] since it's faster, however, the absolute gain from this is minor compared to the cost of 'git reflog'. --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index 225f7312f..221967fc0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-03-14 Daniel Shahaf + * 40817: Completion/Unix/Command/_git: __git_recent_branches: + Retrieve less data, but faster. + * 40822: Doc/Zsh/contrib.yo: vcs_info quilt: Document the '.quilt-foo' zstyle context element. (Compare users/20807.) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 43cbc46ec..73daedcc9 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -6126,12 +6126,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] )) || -- cgit v1.2.3 From e869952200852a414debc6475a652e04e3b03641 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 10 Mar 2017 09:05:17 +0000 Subject: 40818: _git-checkout: When completing local heads, prefer recently-checked-out ones. (after 38592) --- ChangeLog | 4 ++++ Completion/Unix/Command/_git | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index 221967fc0..1a6d16546 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2017-03-14 Daniel Shahaf + * 40818: Completion/Unix/Command/_git: _git-checkout: When + completing local heads, prefer recently-checked-out ones. (after + 38592) + * 40817: Completion/Unix/Command/_git: __git_recent_branches: Retrieve less data, but faster. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 73daedcc9..85aac9264 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -476,7 +476,7 @@ _git-checkout () { # TODO: Allow A...B 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 @@ -6169,6 +6169,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 () { -- cgit v1.2.3 From 4fa7c6aeccf19442e59740d388db5066cb30f3fc Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 9 Apr 2017 17:18:23 +0200 Subject: 40943: __git_recent_commits: prefer recent commit objects Without this "commit to be amended" shows up before "recent commit object name" with `git commit --fixup`, but the recent commit objects are the most useful here. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index cef83e09c..87721928a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-04-23 Daniel Hahler + + * 40943: Completion/Unix/Command/_git: __git_recent_commits: prefer + recent commit objects. + 2017-04-23 Peter Stephenson * 40995: Src/lex.c, Test/D08cmdsubst.ztst: we need to expand diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 85aac9264..a46e3b55d 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -6326,11 +6326,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 } -- cgit v1.2.3 From c5783576e8bcbba5bac4fe9f06699fc8e5a6b8fe Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 22 Jun 2017 10:05:07 +0100 Subject: 41339: Unquote treeish argument for git checkout completion --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index 7699b6528..7c53f70d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-06-22 Peter Stephenson + * 41339: Completion/Unix/Command/_git: unquote treeish argument + for git checkout completion. + * Phil: 41308, tweaked: Src/Modules/pcre.c, Test/V07pcre.ztst: Behaviour of PCRE with NULL bytes. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index a46e3b55d..f764daf75 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -495,8 +495,8 @@ _git-checkout () { 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 -- cgit v1.2.3 From 76a4a5ed3cc11d546897b69498905566326f3f26 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 14 Jul 2017 11:59:31 +0200 Subject: 41419: update for git 2.13.2 --- ChangeLog | 4 ++++ Completion/Unix/Command/_git | 41 ++++++++++++++++++++++++++++++----------- 2 files changed, 34 insertions(+), 11 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index 182f42c1e..ad0589fe5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-07-14 Oliver Kiddle + + * 41419: Completion/Unix/Command/_git: update for git 2.13.2 + 2017-07-13 Peter Stephenson * 41420: Src/glob.c, Test/D09brace.ztst: "{.." wasn't checked diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index f764daf75..dcf1f639c 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]" \ @@ -461,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 @@ -628,7 +630,7 @@ _git-clone () { '(--single-branch)--no-single-branch[clone history leading up to each branch]' \ '--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]' \ @@ -724,6 +726,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]' \ @@ -732,7 +735,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' @@ -1424,6 +1428,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' \ @@ -1609,6 +1614,7 @@ _git-stash () { _arguments -C \ '*::: :->args' \ + '(-m --message)'{-m,--message}'[specify stash description]' \ ${save_arguments//#\(/(* } && ret=0 if [[ -n $state ]]; then @@ -1616,7 +1622,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' @@ -1638,6 +1644,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 @@ -1956,7 +1968,8 @@ _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" @@ -4672,6 +4685,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' \ @@ -4886,7 +4901,8 @@ _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]' \ @@ -4992,7 +5008,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]' \ @@ -5171,6 +5189,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]' \ @@ -5306,7 +5325,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 -- cgit v1.2.3 From 4a63a1793af5f3046af6a77db8aeeece523ebc61 Mon Sep 17 00:00:00 2001 From: Fabian Klötzl Date: Thu, 13 Jul 2017 11:19:14 +0200 Subject: 41414: fix for commas used in exclusion lists also missing escape for _gcc and --no-index option for git diff --- ChangeLog | 5 +++++ Completion/Linux/Command/_iptables | 4 ++-- Completion/Unix/Command/_gcc | 2 +- Completion/Unix/Command/_git | 9 ++++++++- Etc/completion-style-guide | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index ad0589fe5..a8e3dede8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2017-07-14 Oliver Kiddle + * Fabian Klötzl: 41414: Completion/Linux/Command/_iptables, + Completion/Unix/Command/_gcc, Completion/Unix/Command/_git, + Etc/completion-style-guide: fix for commas used in exclusion + lists, missing escape for _gcc and --no-index option for git diff + * 41419: Completion/Unix/Command/_git: update for git 2.13.2 2017-07-13 Peter Stephenson diff --git a/Completion/Linux/Command/_iptables b/Completion/Linux/Command/_iptables index 8f990030c..4178a1a2e 100644 --- a/Completion/Linux/Command/_iptables +++ b/Completion/Linux/Command/_iptables @@ -47,7 +47,7 @@ case ${prev[${prev[(I)-p|--protocol]}+1]}; in esac case ${prev[${prev[(I)-j|--jump]}+1]}; in - DNAT) args+=( '(--to,--to-destination)'{--to,--to-destination}':address:_users-ports' ) ;; + DNAT) args+=( '(--to --to-destination)'{--to,--to-destination}':address:_users-ports' ) ;; DSCP) args+=( '--set-dscp[set the DSCP field]:value' @@ -67,7 +67,7 @@ case ${prev[${prev[(I)-j|--jump]}+1]}; in MARK) args+=( '--set-mark[set fwmark in packet]:number' ) ;; REDIRECT|MASQUERADE) args+=( '--to-ports[port (range) to map to]:port range:_ports' ) ;; REJECT) args+=( '--reject-with[drop packet and send reply]:reject type:->reject-types' ) ;; - SNAT) args+=( '(--to,--to-source)*'{--to,--to-source}'[specify address to map source to]:address:_users-ports' ) ;; + SNAT) args+=( '(--to --to-source)*'{--to,--to-source}'[specify address to map source to]:address:_users-ports' ) ;; TCPMSS) args+=( '--set-mss[explicitly set MSS option]:value' diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index e188c7e9f..28a2ccbda 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -428,7 +428,7 @@ args+=( '-Wdisabled-optimization[Warn when an optimization pass is disabled]' '-Wdiv-by-zero[Warn about compile-time integer division by zero]' '-Wdouble-promotion[Warn about implicit conversions from "float" to "double"]' - '-Weffc++[Warn about violations of Effective C++ style rules]' + '-Weffc\+\+[Warn about violations of Effective C++ style rules]' '-Wempty-body[Warn about an empty body in an if or else statement]' '-Wendif-labels[Warn about stray tokens after #elif and #endif]' '-Wenum-compare[Warn about comparison of different enum types]' diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index dcf1f639c..aacd3bfd7 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -756,7 +756,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 @@ -774,6 +775,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) diff --git a/Etc/completion-style-guide b/Etc/completion-style-guide index e91e92307..a6fc737a7 100644 --- a/Etc/completion-style-guide +++ b/Etc/completion-style-guide @@ -64,7 +64,7 @@ tells _wanted where to put options specifying the `directory' description. Where two matches have identical meaning, give them the same description so that the completion system can group them together. Conventionally a brace expansion of this form is used: - '(--context,-C)'{--context=,-C-}'[specify lines of context]:lines' + '(--context -C)'{--context=,-C-}'[specify lines of context]:lines' You won't need the exclusion list if the option can be specified multiple times. It can also be useful to use the same description for matches which are completely opposite in their meaning if it shortens -- cgit v1.2.3 From 562482a49505774f3b24e05297bcc42b68624dfb Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 31 Jul 2017 00:52:31 +0000 Subject: unposted: _git: Fix style lookup for 'max-verbose'. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index 24855de34..a5480b15b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-07-31 Daniel Shahaf + + * unposted: Completion/Unix/Command/_git: Fix style lookup for + 'max-verbose'. + 2017-07-29 Peter Stephenson * unposted: Etc/FAQ.yo, NEWS, README: update in preparation for diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index aacd3bfd7..ce8a4049d 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5515,7 +5515,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 -- cgit v1.2.3 From 17a6eb655d0952c090c36abeec4ba17c11b3b165 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 31 Jul 2017 00:59:33 +0000 Subject: 41475: _git: Complete files after 'reset' when there are no commits, when the 'verbose' style is set. --- ChangeLog | 6 ++++++ Completion/Unix/Command/_git | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index ad2d453bd..d6d6bb382 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-08-02 Daniel Shahaf + + * 41475: Completion/Unix/Command/_git: Complete files after + 'reset' when there are no commits, when the 'verbose' style + is set. + 2017-08-01 Peter Stephenson * 41470: Doc/Zsh/builtins.yo: note that 41464 stops exec finding diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index ce8a4049d..032cbad1e 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1462,6 +1462,12 @@ _git-reset () { case $state in (file) local tree=HEAD + if zstyle -t :completion:${curcontext}: verbose; then + if ! _call_program headed git rev-parse --verify HEAD 2>/dev/null; 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 -- cgit v1.2.3 From 943a061ea5200e0fe84e0c5765369241321fe365 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 6 Aug 2017 00:28:22 +0200 Subject: 41493: fix to not print hash into terminal and update options for git 2.14 --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/ChangeLog b/ChangeLog index 009970604..713950f74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-08-05 Oliver Kiddle + * 41493: Completion/Unix/Command/_git: fix to not print hash + into terminal and update options for git 2.14 + * 41492: Completion/BSD/Command/_gstat, Completion/Unix/Command/_flex, Completion/Unix/Command/_sqlite, Completion/Unix/Command/_sudo: update options in completions diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 032cbad1e..518e6d198 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -628,6 +628,7 @@ _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]::file:__git_files' \ @@ -1454,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' \ @@ -1463,7 +1465,7 @@ _git-reset () { (file) local tree=HEAD if zstyle -t :completion:${curcontext}: verbose; then - if ! _call_program headed git rev-parse --verify HEAD 2>/dev/null; then + if ! tree=$(_call_program headed git rev-parse --verify HEAD); then # well-known sha1 of the empty tree tree=4b825dc642cb6eb9a060e54bf8d69288fbee4904 fi @@ -1721,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)"))' \ @@ -3372,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' \ @@ -3643,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]' } -- cgit v1.2.3