summary refs log tree commit diff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2011-09-22 18:13:23 +0200
committerMikael Magnusson <mikachu@gmail.com>2015-08-12 17:54:07 +0200
commit8815500f95aeb7599704877a80a392321f753f43 (patch)
treeea16576de88ba3cdd0d1487c32cc65c2a051d336
parent46a46a90c21b1e091daf46d7f0049dd169667158 (diff)
downloadzsh-8815500f95aeb7599704877a80a392321f753f43.tar.gz
zsh-8815500f95aeb7599704877a80a392321f753f43.tar.xz
zsh-8815500f95aeb7599704877a80a392321f753f43.zip
36116: _git: various fixes
Add = to git checkout --conflict= completion
fix transposed [-
git push remote argument is not optional
can use shorter syntax for a check
-rw-r--r--ChangeLog2
-rw-r--r--Completion/Unix/Command/_git10
2 files changed, 7 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1d3ce244f..77e18c537 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,8 @@
 	* 36078: Doc/Zsh/contrib.yo: vcs_info: Adjust documentation for
 	no longer exporting
 
+	* 36116: Completion/Unix/Command/_git: various fixes
+
 2015-08-11  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* 36108: NEWS: list of major changes so far since 5.0.8
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 5b78a2b81..4357b7448 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -132,7 +132,7 @@ _git-archive () {
 
   declare -a backend_args
 
-  if (( words[(I)--format=*] > 0 && words[(I)--format=*] < CURRENT )); then
+  if (( words[(b:CURRENT-1:I)--format=*] )); then
     case ${words[$words[(I)--format=*]]#--format=} in
       (zip)
         backend_args=(
@@ -442,7 +442,7 @@ _git-checkout () {
     '(-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)' \
+    '(-q --quiet -f --force -m --merge --patch)--conflict=[same as --merge, using given merge style]:style:(merge diff3)' \
     '(-)'{-p,--patch}'[interactively select hunks in diff between given tree-ish and working tree]' \
     '(-)--[start file arguments]' \
     '*:: :->branch-or-tree-ish-or-file' && ret=0
@@ -1285,7 +1285,7 @@ _git-push () {
     '(--verify)--no-verify[bybass the pre-push hook]' \
     '--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_any_repositories' \
     '*: :__git_ref_specs' && ret=0
 
   case $state in
@@ -6356,8 +6356,8 @@ __git_setup_revision_options () {
     '*--not[reverses meaning of ^ prefix for revisions that follow]'
     '--all[show all commits from refs]'
     '--branches=-[show all commits from refs/heads]::pattern'
-    '--tags=[-show all commits from refs/tags]::pattern'
-    '--remotes=[-show all commits from refs/remotes]::pattern'
+    '--tags=-[show all commits from refs/tags]::pattern'
+    '--remotes=-[show all commits from refs/remotes]::pattern'
     '--glob=[show all commits from refs matching glob]:pattern'
     '--exclude=[do not include refs matching glob]:pattern'
     '--exclude=[do not include refs matching glob]:pattern'