Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from nm36.bullet.mail.ir2.yahoo.com by f.primenet.com.au (envelope-from <okiddle@yahoo.co.uk>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(212.82.96.61):SA:0(0.0/5.0):. 
 Processed in 3.764776 secs); 12 Aug 2016 23:33:10 -0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS,
	T_DKIM_INVALID,T_FILL_THIS_FORM_SHORT autolearn=unavailable
	autolearn_force=no version=3.4.1
X-Envelope-From: okiddle@yahoo.co.uk
X-Qmail-Scanner-Mime-Attachments: |
X-Qmail-Scanner-Zip-Files: |
Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.mail.yahoo.com designates 212.82.96.61 as permitted sender)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1471044386; bh=MMo/wXPCn4exavm9i1IpCXfQSBELB0BnkgfULEpGB7w=; h=From:To:Subject:Date:From:Subject; b=byes2ZxX6SxUYZ0U4hNVKghH7HXg3AcyZfEWaBS3MHaedSFrlFWmzQ/X/HmgwGonz1PjBZTvHtlzHI9hJvYIo9E7eXvsaUc5C6Au7Mvia7VHMrNyAJiMqs49ZXHJh0V9dpP3hDjO/2W9uW2suQdqNtBEt8i0zkCYEIBIuLAKvYgqwcRI1GUDtV3mLAkeDUD48az8bGoPtYcDE2TnLr0A4MR8R43MsrFwjC4aCxPOvu+ZVlXzn33AsmZDmIp0poi0nyGb4UpRaEvjKG2q1vWWBdeDmgOLZ3UaUshNWULF3WnHvY7zfPQAbPn+n6au3Pb7FiQTuTjB/Z+O1d9GGzrJ0A==
X-Yahoo-Newman-Id: 703290.57233.bm@smtp141.mail.ir2.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: s1fXyL0VM1m.iSf7CTQSS25fbWPoh2xXT9DqOUGuQm.WDFm
 kmcosnqeEhu01Y1X4olFJZcJ7jgS4r7P1Y7efZy51ya5miLyHVtdSzQOo13j
 fGOgol3XRfPMRNmoZ568I5BzNN2sQDe7Cx4I9fwJ6IAAerXwJ7Zaev0rgIy_
 SAFQU2L8I07QYED9rRJ3l2g9xLtAhETRx3_FyP2FSi.LkYlY442sfdQhoEbC
 TQB57TAzvZDngeKjUK_HasM.SebB7cNIu61VwczW05owktvKQOzRpbZgd6n9
 nr1OHJ_RBH9KENrVZOrggNuqXiSTKPtJsigZZ1lR_p02ArmljNCsC3qNBIgk
 aL0ilLAJFoJq2xYz.HSDP9SQR1ZBvGjUzoDVPOTpBf3ox6oVlZxtsLjHijwn
 t6i5sNMZn0T3oUg4m0aGzbn81PbJAbo1Ma5ce.Za5GydhJPsiGYmyMUiotZF
 Qu2lmNbgFvk7.5CwG5lWJ7OJAzPIVt4GoDnOzDyZGYeT1kb_.Me7KPh85jzi
 IJo56Gpnk7Tfbucc9y7kca3lmkNZjY0fl3b0nPLa406c-
X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI-
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: update options for git completion
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <99618.1471044385.1@hydra.kiddle.eu>
Content-Transfer-Encoding: quoted-printable
Date: Sat, 13 Aug 2016 01:26:25 +0200
Message-ID: <99619.1471044385@hydra.kiddle.eu>
X-Seq: zsh-workers 39036

This updates _git for new options up to git 2.9.2. Completion for
one or two subcommands is also added, in particular git worktree.
There is also the odd cleanup like -w options to _arguments.  Some
options that were marked undocumented are documented in the short
help form (-h). For _git-svn, I've changed it to make liberal use
of ;| in the case statement rather than gathering options into a
bunch of different variables. I tend to find this easier to follow
and less error prone.

Thanks to Bart and Daniel for pointing out the mistake in the
previous patch for --sign. yes and no are valid as arguments to
--sign: there's a discrepancy between git's short and long help
forms. Both forms are valid and both are now completed.

_git-svn and _git_subtree should perhaps be factored out into their own
files as git-svn and git-subtree are not really part of core git.

Oliver

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index b0f8241..78f0564 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -53,7 +53,7 @@ _git-add () {
     ignore_missing=3D'--ignore-missing[check if files (even missing) are =
ignored in dry run]'
   fi
 =

-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '(-n --dry-run)'{-n,--dry-run}'[do not actually add files; only show =
which ones would be added]' \
     '(-v --verbose)'{-v,--verbose}'[show files as they are added]' \
     '(-f --force)'{-f,--force}'[allow adding otherwise ignored files]' \
@@ -67,6 +67,7 @@ _git-add () {
     '--refresh[do not add files, but refresh their stat() info in index]'=
 \
     '--ignore-errors[continue adding if an error occurs]' \
     $ignore_missing \
+    '--chmod[override the executable bit of the listed files]:override:(-=
x +x)' \
     '*:: :->file' && return
 =

   case $state in
@@ -101,9 +102,10 @@ _git-am () {
   _arguments -S \
     '(-s --signoff)'{-s,--signoff}'[add Signed-off-by: line to the commit=
 message]' \
     '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=3D-}'[GPG-sign the com=
mit]::key id' \
-    '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commi=
t]' \
+    "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit=
]" \
     '(-k --keep)'{-k,--keep}'[pass -k to git mailinfo]' \
     '--keep-non-patch[pass -b to git mailinfo]' \
+    '(-m --message-id)'{-m,--message-id}'[pass -m flag to git-mailinfo]' =
\
     '(          --no-keep-cr)--keep-cr[pass --keep-cr to git mailsplit]' =
\
     '(--keep-cr             )--no-keep-cr[do not pass --keep-cr to git ma=
ilsplit]' \
     '(-c --scissors --no-scissors)'{-c,--scissors}'[strip everything befo=
re a scissors line]' \
@@ -150,12 +152,12 @@ _git-archive () {
     esac
   fi
 =

-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '--format=3D-[format of the resulting archive]:archive format:__git_a=
rchive_formats' \
     '(- :)'{-l,--list}'[list available archive formats]' \
     '(-v --verbose)'{-v,--verbose}'[report progress to stderr]' \
     '--prefix=3D-[prepend the given path prefix to each filename]:path pr=
efix:_directories -r ""' \
-    '--output=3D[write archive to argument instead of stdout]:archive:_fi=
les' \
+    '(-o --output)'{-o+,--output=3D}'[write archive to specified file]:ar=
chive:_files' \
     '--worktree-attributes[look for attributes in .gitattributes in worki=
ng directory too]' \
     $backend_args \
     '--remote=3D[archive remote repository]:remote repository:__git_any_r=
epositories' \
@@ -190,6 +192,13 @@ _git-bisect () {
   # subcommand might be removed from the UI level.
   local curcontext=3D$curcontext state line ret=3D1
   declare -A opt_args
+  local good bad
+
+  if good=3D$(_call_program commands git terms --term-good); then
+    bad=3D$(_call_program commands git terms --term-bad)
+  else
+    good=3D( good old ) bad=3D( new bad )
+  fi
 =

   _arguments -C \
     '--help[display git-bisect manual page]' \
@@ -203,15 +212,16 @@ _git-bisect () {
       commands=3D(
         help:'display a short usage description'
         start:'reset bisection state and start a new bisection'
-        bad:'mark current or given revision as bad'
-        good:'mark current or given revision as good'
+        ${^bad}:'mark current or given revision as bad'
+        ${^good}:'mark current or given revision as good'
         skip:'choose a nearby commit'
         next:'find next bisection to test and check it out'
         reset:'finish bisection search and return to the given branch (or=
 master)'
         visualize:'show the remaining revisions in gitk'
         view:'show the remaining revisions in gitk'
         replay:'replay a bisection log'
-        log:'show the log of the current bisection'
+        terms:'show currently used good/bad terms'
+        log:'show log of the current bisection'
         run:'run evaluation script')
 =

       _describe -t commands command commands && ret=3D0
@@ -222,6 +232,9 @@ _git-bisect () {
       case $line[1] in
         (start)
           _arguments -C \
+	    --term-{good,old}'=3D[specify alternate term for good revisions]:ter=
m' \
+	    --term-{bad,new}'=3D[specify alternate term for bad revisions]:term'=
 \
+	    '--no-checkout[set BISECT_HEAD reference instead of doing checkout a=
t each iteration]' \
             ':bad revision:__git_commits' \
             '*: :->revision-or-path' && ret=3D0
           case $state in
@@ -236,11 +249,11 @@ _git-bisect () {
               ;;
           esac
           ;;
-        (bad)
+        (${(j.|.)~good})
           _arguments \
             ': :__git_commits' && ret=3D0
           ;;
-        (good|skip)
+        (${(j.|.)~good}|skip)
           # TODO: skip can take revlists.
           _arguments \
             '*: :__git_commits' && ret=3D0
@@ -257,12 +270,15 @@ _git-bisect () {
           _arguments \
             '*:: : _normal' && ret=3D0
           ;;
+        (terms)
+	  _arguments --term-good --term-bad && ret=3D0
+	  ;;
         (view|visualize)
           local -a log_options revision_options
           __git_setup_log_options
           __git_setup_revision_options
 =

-          _arguments -w -C -s \
+          _arguments -C -s \
             $log_options \
             $revision_options && ret=3D0
         (*)
@@ -279,14 +295,14 @@ _git-bisect () {
 _git-branch () {
   declare l c m d e
 =

-  l=3D'--color --no-color -r -a -v --verbose --abbrev --no-abbrev --list'
-  c=3D'-l -f --force -t --track --no-track -u --set-upstream --set-upstre=
am-to --unset-upstream --contains --merged --no-merged'
+  l=3D'--color --no-color -r --remotes -a -v --verbose --abbrev --no-abbr=
ev --list --points-at --sort'
+  c=3D'-l --create-reflog -f --force -t --track --no-track -u --set-upstr=
eam --set-upstream-to --unset-upstream --contains --merged --no-merged'
   m=3D'-m --move -M'
   d=3D'-d --delete -D'
   e=3D'--edit-description'
 =

   declare -a dependent_creation_args
-  if (( words[(I)-r] =3D=3D 0 )); then
+  if (( words[(I)(-r|--remotes)] =3D=3D 0 )); then
     dependent_creation_args=3D(
       "($l $m $d): :__git_branch_names"
       "::start-point:__git_revisions")
@@ -297,7 +313,7 @@ _git-branch () {
     dependent_creation_args=3D
     dependent_deletion_args=3D(
       '-r[delete only remote-tracking branches]')
-    if (( words[(I)-r] )); then
+    if (( words[(I)(-r|--remotes)] )); then
       dependent_deletion_args+=3D'*: :__git_ignore_line_inside_arguments =
__git_remote_branch_names'
     else
       dependent_deletion_args+=3D'*: :__git_ignore_line_inside_arguments =
__git_branch_names'
@@ -312,18 +328,18 @@ _git-branch () {
       '::new branch name:__git_branch_names')
   fi
 =

-  _arguments -w -S -s \
+  _arguments -S -s \
     "($c $m $d $e --no-color :)--color=3D-[turn on branch coloring]:: :__=
git_color_whens" \
     "($c $m $d $e : --color)--no-color[turn off branch coloring]" \
     "($c $m $d $e --no-column)"'--column=3D[display tag listing in column=
s]:column.branch option:((always\:"always show in columns" never\:"never s=
how in columns" auto\:"show in columns if the output is to the terminal" c=
olumn\:"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"))' \
     "($c $m $d $e --column)"'--no-column[do not display in columns]' \
     "($c $m $d $e )*--list[list only branches matching glob]:pattern" \
-    "($c $m    $e  -a)-r[list or delete only remote-tracking branches]" \
-    "($c $m $d $e: -r)-a[list both remote-tracking branches and local bra=
nches]" \
-    "($c $m $d $e : -v -vv --verbose)"{-v,-vv--verbose}'[show SHA1 and co=
mmit subject line for each head]' \
+    "($c $m    $e  -a)"{-r,--remotes}'[list or delete only remote-trackin=
g branches]' \
+    "($c $m $d $e: -r --remotes)-a[list both remote-tracking branches and=
 local branches]" \
+    "($c $m $d $e : -v -vv --verbose)"{-v,-vv,--verbose}'[show SHA1 and c=
ommit subject line for each head]' \
     "($c $m $d $e :)--abbrev=3D[set minimum SHA1 display-length]: :__git_=
guard_number length" \
     "($c $m $d $e :)--no-abbrev[do not abbreviate sha1s]" \
-    "($l $m $d $e)-l[create the branch's reflog]" \
+    "($l $m $d $e)"{-l,--create-reflog}"[create the branch's reflog]" \
     "($l $m $d $e -f --force)"{-f,--force}"[force the creation of a new b=
ranch]" \
     "($l $m $d $e -t --track)"{-t,--track}"[set up configuration so that =
pull merges from the start point]" \
     "($l $m $d $e)--no-track[override the branch.autosetupmerge configura=
tion variable]" \
@@ -331,7 +347,7 @@ _git-branch () {
     "($l $m $d $e -u --set-upstream --set-upstream-to --unset-upstream)--=
unset-upstream[remove upstream configuration]" \
     "($l $m $d $e)--contains=3D[only list branches which contain the spec=
ified commit]: :__git_committishs" \
     "($l $m $d $e)--merged=3D[only list branches which are fully containe=
d by HEAD]: :__git_committishs" \
-    "($l $m $d $e)--no-merged=3D[do not list branches which are fully con=
tained by HEAD]: :__git_committishs" \
+    "($l $m $d $e)--no-merged=3D[don't list branches which are fully cont=
ained 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]" \
@@ -340,6 +356,8 @@ _git-branch () {
     "($l $c $m $d $e)"{-d,--delete}"[delete a fully merged branch]" \
     "($l $c $m $d $e)-D[delete a branch]" \
     {-q,--quiet}"[be more quiet]" \
+    '*--sort=3D[specify field to sort on]: :__git_ref_sort_keys' \
+    '--points-at=3D[only list tags of the given object]: :__git_commits' =
\
     $dependent_deletion_args
 }
 =

@@ -376,7 +394,7 @@ _git-bundle () {
             local revision_options
             __git_setup_revision_options
 =

-            _arguments -w -S -s \
+            _arguments -S -s \
               $revision_options \
               ': :_files' \
               '*: :__git_commit_ranges2' && ret=3D0
@@ -429,22 +447,24 @@ _git-checkout () {
   local curcontext=3D$curcontext state line ret=3D1
   declare -A opt_args
 =

-  _arguments -w -C -s \
-    '(-q --quiet)'{-q,--quiet}'[suppress feedback messages]' \
+  _arguments -C -s \
+    '(-q --quiet --progress)'{-q,--quiet}'[suppress progress reporting]' =
\
     '(-f --force -m --merge --conflict --patch)'{-f,--force}'[force branc=
h switch/ignore unmerged entries]' \
-    '(-q --quiet        --theirs --patch)--ours[check out stage #2 for un=
merged paths]' \
-    '(-q --quiet --ours          --patch)--theirs[check out stage #3 for =
unmerged paths]' \
-    '(   -B --orphan --ours --theirs --conflict --patch --detach)-b+[crea=
te a new branch based at given commit]: :__git_branch_names' \
-    '(-b    --orphan --ours --theirs --conflict --patch --detach)-B+[crea=
te or update branch based at given commit]: :__git_branch_names' \
+    '(-q --quiet -2 --ours -3 --theirs --patch)'{-2,--ours}'[check out st=
age #2 for unmerged paths]' \
+    '(-q --quiet -2 --ours -3 --theirs --patch)'{-3,--theirs}'[check out =
stage #3 for unmerged paths]' \
+    '(   -B --orphan -2 --ours -3 --theirs --conflict --patch --detach)-b=
+[create a new branch based at given commit]: :__git_branch_names' \
+    '(-b    --orphan -2 --ours -3 --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 configur=
ation 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)--detach[detach the HEAD at named=
 commit]' \
     '(-b -B -t --track --patch --detach)--orphan=3D[create a new orphan b=
ranch 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=3D[same as --me=
rge, using given merge style]:style:(merge diff3)' \
     '(-)'{-p,--patch}'[interactively select hunks in diff between given t=
ree-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]" \
+    '(-q --quiet)--progress[force progress reporting]' \
     '(-)--[start file arguments]' \
     '*:: :->branch-or-tree-ish-or-file' && ret=3D0
 =

@@ -500,15 +520,17 @@ _git-cherry-pick () {
     '(- :)--quit[end revert or cherry-pick sequence]' \
     '(- :)--continue[resume revert or cherry-pick sequence]' \
     '(- :)--abort[cancel revert or cherry-pick sequence]' \
+    '--allow-empty[preserve initially empty commits]' \
     '--allow-empty-message[allow replaying a commit with an empty message=
]' \
     '--keep-redundant-commits[keep cherry-picked commits that will become=
 empty]' \
     '(-e --edit --ff)'{-e,--edit}'[edit commit before committing the reve=
rt]' \
     '(--ff)-x[append information about what commit was cherry-picked]' \
     '(-m --mainline)'{-m+,--mainline=3D}'[specify mainline when cherry-pi=
cking a merge commit]:parent number' \
+    '--rerere-autoupdate[update index with reused conflict resolution if =
possible]' \
     '(-n --no-commit --ff)'{-n,--no-commit}'[do not make the actually com=
mit]' \
     '(-s --signoff --ff)'{-s,--signoff}'[add Signed-off-by line at the en=
d of the commit message]' \
     '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=3D-}'[GPG-sign the com=
mit]::key id' \
-    '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commi=
t]' \
+    "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit=
]" \
     '*'{-s+,--strategy=3D}'[use given merge strategy]:merge strategy:__gi=
t_merge_strategies' \
     '*'{-X+,--strategy-option=3D}'[pass merge-strategy-specific option to=
 merge strategy]:option' \
     '(-e --edit -x -n --no-commit -s --signoff)--ff[fast forward, if poss=
ible]' \
@@ -525,12 +547,12 @@ _git-clean () {
   local curcontext=3D$curcontext state line ret=3D1
   declare -A opt_args
 =

-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '-d[also remove untracked directories]' \
     '(-f --force)'{-f,--force}'[required when clean.requireForce is true =
(default)]' \
     '(-i --interactive)'{-i,--interactive}'[show what would be done and c=
lean files interactively]' \
     '(-n --dry-run)'{-n,--dry-run}'[only show what would and what would n=
ot be removed]' \
-    '(-q --quiet)'{-q,--quiet}'[only report errors]' \
+    '(-q --quiet)'{-q,--quiet}"[don't print names of files removed]" \
     '*'{-e+,--exclude=3D}'[skip files matching specified pattern]:pattern=
' \
     '(-X   )-x[also remove ignored files]' \
     '(   -x)-X[remove only ignored files]' \
@@ -585,11 +607,12 @@ _git-clone () {
   # TODO: Argument to -o should be a remote name.
   # TODO: Argument to -b should complete branch names in the repository b=
eing
   # cloned (see __git_references())
-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '(-l --local --no-local)'{-l,--local}'[clone locally, hardlink refs a=
nd objects if possible]' \
     '(-l --local --no-local)--no-local[override --local, as if file:/// U=
RL was given]' \
     '--no-hardlinks[copy files instead of hardlinking when doing a local =
clone]' \
     '(-s --shared)'{-s,--shared}'[share the objects with the source repos=
itory (warning: see man page)]' \
+    '(-j --jobs)'{-j+,--jobs=3D}'[specify number of submodules cloned in =
parallel]:jobs' \
     '--reference[reference repository]:repository:_directories' \
     '--dissociate[make the newly-created repository independent of the --=
reference repository]' \
     '(-q --quiet)'{-q,--quiet}'[operate quietly]' \
@@ -606,8 +629,12 @@ _git-clone () {
     '--depth[create a shallow clone, given number of revisions deep]: :__=
git_guard_number depth' \
     '(--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]' \
+    '--shallow-submodules[any cloned submodules will be shallow]' \
     '--recursive[initialize all contained submodules]' \
+    '--recurse-submodules[initialize submodules in the clone]' \
     '--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]' \
     ': :->repository' \
     ': :_directories' && ret=3D0
 =

@@ -626,7 +653,7 @@ _git-clone () {
 =

 (( $+functions[_git-column] )) ||
 _git-column () {
-  _arguments -w -S -s \
+  _arguments -s \
     '--command=3D[look up layout mode using config vars column.<name> and=
 column.ui]' \
     '--mode=3D[specify layout mode. See configuration variable column.ui =
for option syntax]' \
     '--raw-mode=3D[same as --mode but take mode encoded as a number]' \
@@ -649,14 +676,15 @@ _git-commit () {
   fi
 =

   # TODO: --interactive isn't explicitly listed in the documentation.
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(-a --all --interactive -o --only -i --include *)'{-a,--all}'[stage =
all modified and deleted paths]' \
     '--fixup=3D[construct a commit message for use with rebase --autosqua=
sh]:commit to be amended:__git_recent_commits' \
     '--squash=3D[construct a commit message for use with rebase --autosqu=
ash]:commit to be amended:__git_recent_commits' \
     $reset_author_opt \
-    '(        --porcelain --dry-run)--short[output dry run in short forma=
t]' \
-    '(--short             --dry-run)--porcelain[output dry run in porcela=
in-ready format]' \
-    '(--short --porcelain --dry-run -z --null)'{-z,--null}'[separate dry =
run entry output with NUL]' \
+    '(        --porcelain --dry-run)--short[dry run with short output for=
mat]' \
+    '--branch[show branch information]' \
+    '(--short             --dry-run)--porcelain[dry run with machine-read=
able output format]' \
+    '(--short --porcelain --dry-run -z --null)'{-z,--null}'[dry run with =
NULL-separated output format]' \
     {-p,--patch}'[use the interactive patch selection interface to chose =
which changes to commit]' \
     '(--reset-author)--author[override the author name used in the commit=
]:author name' \
     '--date=3D[override the author date used in the commit]:date' \
@@ -683,7 +711,7 @@ _git-commit () {
     '(         --no-status)--status[include the output of git status in t=
he commit message template]' \
     '(--status            )--no-status[do not include the output of git s=
tatus in the commit message template]' \
     '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=3D}'[GPG-sign the comm=
it]::key id' \
-    '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commi=
t]' \
+    "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit=
]" \
     '(-a --all --interactive -o --only -i --include *)--interactive[inter=
actively update paths in the index file]' \
     $amend_opt \
     '*: :__git_ignore_line_inside_arguments __git_changed_files' \
@@ -697,7 +725,7 @@ _git-commit () {
 =

 (( $+functions[_git-describe] )) ||
 _git-describe () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(*)--dirty=3D-[describe HEAD, adding mark if dirty]::mark' \
     '--all[use any ref found in "$GIT_DIR/refs/"]' \
     '--tags[use any ref found in "$GIT_DIR/refs/tags"]' \
@@ -722,9 +750,10 @@ _git-diff () {
   __git_setup_diff_options
   __git_setup_diff_stage_options
 =

-  _arguments -w -C -s \
+  _arguments -C -s \
     $* \
     $diff_options \
+    '(--exit-code)--quiet[disable all output]'
     $diff_stage_options \
     '(--cached --staged)'{--cached,--staged}'[show diff between index and=
 named commit]' \
     '(-)--[start file arguments]' \
@@ -818,9 +847,10 @@ _git-fetch () {
   local -a fetch_options
   __git_setup_fetch_options
 =

-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     $fetch_options \
-    '--multiple[allow several repository arguments]' \
+    '(-n --no-tags -t --tags)'{-n,--no-tags}'[disable automatic tag follo=
wing]'
+    '(--all -m --multiple)'{-m,--multiple}'[fetch from multiple remotes]'=
 \
     '*:: :->repository-or-group-or-refspec' && ret=3D0
 =

   case $state in
@@ -851,7 +881,7 @@ _git-format-patch () {
   # TODO: -- is wrong.
   # TODO: Should filter out --name-only, --name-status, and --check from
   # $diff_options.
-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     $diff_options \
     '--[limit the number of patches to prepare]: :__git_guard_number "num=
ber of patches to prepare"' \
     '(-o --output-directory --stdout)'{-o+,--output-directory=3D}'[store =
resulting files in given directory]: :_directories' \
@@ -882,9 +912,10 @@ _git-format-patch () {
     '(--signature                --signature-file)--no-signature[do not a=
dd a signature]' \
     '(--signature --no-signature                 )--signature-file=3D[use=
 contents of file as signature]' \
     '--suffix=3D[use the given suffix for filenames]:filename suffix' \
-    '--quiet[suppress the output of the names of generated files]' \
+    '(-q --quiet)'{-q,--quiet}'[suppress the output of the names of gener=
ated files]' \
     '--no-binary[do not output contents of changes in binary files, only =
note that they differ]' \
     '--root[treat the revision argument as a range]' \
+    '--zero-commit[output all-zero hash in From header]' \
     ': :->commit-or-commit-range' && ret=3D0
 =

   case $state in
@@ -902,12 +933,12 @@ _git-format-patch () {
 =

 (( $+functions[_git-gc] )) ||
 _git-gc () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '--aggressive[more aggressively optimize]' \
     '--auto[check whether housekeeping is required]' \
     '(        --no-prune)--prune=3D[prune loose objects older than given =
date]: :__git_datetimes' \
     '(--prune           )--no-prune[do not prune any loose objects]' \
-    '--quiet[suppress all progress reports]'
+    '(-q --quiet)'{-q,--quiet}'[suppress progress reporting]'
 }
 =

 (( $+functions[_git-grep] )) ||
@@ -929,9 +960,9 @@ _git-grep () {
   _arguments -C -A '-*' \
     '(-O --open-files-in-pager --no-index)--cached[search blobs registere=
d in index file instead of working tree]' \
     '(--cached)--no-index[search files in current directory, not just tra=
cked files]' \
-    '(--exclude-standard)--no-exclude-standard[also search in ignored fil=
es]' \
+    '(--exclude-standard)--no-exclude-standard[search also in ignored fil=
es]' \
     '(--no-exclude-standard)--exclude-standard[exclude files standard ign=
ore mechanisms]' \
-    '--untracked[search in untracked files]' \
+    '--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]=
' \
     '(--textconv --no-textconv)--no-textconv[do not honor textconv filter=
 settings]' \
@@ -960,6 +991,7 @@ _git-grep () {
     '(-A --after-context)'{-A+,--after-context=3D}'[show <num> trailing l=
ines, and separate groups of matches]: :__git_guard_number lines' \
     '(-B --before-context)'{-B+,--before-context=3D}'[show <num> leading =
lines, and separate groups of matches]: :__git_guard_number lines' \
     '(-A --after-context -B --before-context -C --context)'{-C+,--context=
=3D}'[show <num> leading and trailing lines, and separate groups of matche=
s]: :__git_guard_number lines' \
+    '--threads=3D[use specified number of threads]:threads' \
     '(-p --show-function)'{-p,--show-function}'[show preceding line conta=
ining function name of match]' \
     '(-W --function-context)'{-W,--function-context}'[show whole function=
 where a match was found]' \
     '(1)*-f+[read patterns from given file]:pattern file:_files' \
@@ -1070,7 +1102,7 @@ _git-gui () {
 =

 (( $+functions[_git-init] )) ||
 _git-init () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(-q --quiet)'{-q,--quiet}'[do not print any results to stdout]' \
     '--bare[create a bare repository]' \
     '--template=3D[directory to use as a template for the object database=
]: :_directories' \
@@ -1088,10 +1120,9 @@ _git-log () {
   __git_setup_log_options
   __git_setup_revision_options
 =

-  _arguments -w -C -s \
+  _arguments -C -s \
     $log_options \
     $revision_options \
-    '-L+[trace the evolution of a line range or regex within a file]:rang=
e' \
     '(-)--[start file arguments]' \
     '1: :->first-commit-ranges-or-files' \
     '*: :->commit-ranges-or-files' && ret=3D0
@@ -1134,12 +1165,14 @@ _git-merge () {
   __git_setup_merge_options
   local -a git_commit_opts=3D(--all --not HEAD --not)
 =

-  _arguments -w -S -s \
+  _arguments -S -s \
     $merge_options \
     '-m+[set the commit message to be used for the merge commit]:merge me=
ssage' \
+    '(--edit --no-edit)-e[open an editor to change the commit message]' \
     '(                    --no-rerere-autoupdate)--rerere-autoupdate[allo=
w the rerere mechanism to update the index]' \
     '(--rerere-autoupdate                       )--no-rerere-autoupdate[d=
o not allow the rerere mechanism to update the index]' \
     '--abort[restore the original branch and abort the merge operation]' =
\
+    '--progress[force progress reporting]' \
     '*: : __git_commits -O expl:git_commit_opts'
 }
 =

@@ -1148,7 +1181,7 @@ _git-mv () {
   local curcontext=3D$curcontext state line ret=3D1
   declare -A opt_args
 =

-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '(-v --verbose)'{-v,--verbose}'[output additional information]' \
     '(-f --force)'{-f,--force}'[rename/move even if targets exist]' \
     '-k[skip rename/move that would lead to errors]' \
@@ -1190,7 +1223,9 @@ _git-notes () {
         merge:'merge the given notes ref into the current ref'
         show:'show notes for a given object'
         remove:'remove notes for a given object'
-        prune:'remove all notes for non-existing/unreachable objects')
+        prune:'remove all notes for non-existing/unreachable objects'
+        get-ref:'print the current notes ref'
+      )
 =

       _describe -t commands command commands && ret=3D0
       ;;
@@ -1198,14 +1233,14 @@ _git-notes () {
       curcontext=3D${curcontext%:*}-$line[1]:
 =

       case $line[1] in
-        (list|show|edit|remove)
+        (list|show)
           _arguments \
             ': :__git_commits' && ret=3D0
           ;;
         (add)
           # TODO: Only complete commits that don't have notes already, un=
less
           # -f or --force has been given.
-          _arguments -w -S -s \
+          _arguments -S -s \
             '*'{-m+,--message=3D}'[use given note message]:message' \
             '*'{-F+,--file=3D}'[take note message from given file]:note m=
essage file:_files' \
             '(-C --reuse-message)'{-C+,--reuse-message=3D}'[take note mes=
sage from given blob object]: :__git_blobs' \
@@ -1215,24 +1250,35 @@ _git-notes () {
           ;;
         (copy)
           # TODO: --for-rewrite is undocumented.
-          _arguments -w -S -s \
+          _arguments -S -s \
             '(-f --force)'{-f,--force}'[replace existing note]' \
             '(:)--stdin[read objects from stdin]' \
             '(:--stdin)--for-rewrite=3D[load rewriting config for given c=
ommand]:command:(amend rebase)' \
             ': :__git_commits' \
             ': :__git_commits' && ret=3D0
           ;;
+	(edit)
+	  _arguments --allow-empty ':object:__git_commits' && ret=3D0
+	  ;;
         (merge)
-          _arguments -w -S -s \
+          _arguments -S -s \
             '(-s --strategy)--abort[abort an in-progress notes merge]' \
             '(-s --strategy)--commit[finalize an in-progress notes merge]=
' \
-            {-q,--quiet}'[be quiet]' \
-            {-v,--verbose}'[be more verbose]' \
+	    '(-q --quiet)'{-q,--quiet}'[be quiet]' \
+            '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
             '(--abort --commit)'{-s,--strategy=3D}'[resolve conflicts usi=
ng the given strategy]' \
             ': :__git_notes_refs' && ret=3D0
           ;;
+	(prune)
+	  _arguments -s \
+	    '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
+	    '(-n --dry-run)'{-n,--dry-run}"[don't remove anything, just report w=
hat would be deleted]" && ret=3D0
+          ;;
+	(remove)
+	  _arguments --ignore-missing --stdin ':object:__git_commits' && ret=3D0
+	  ;;
         (append)
-          _arguments -w -S -s \
+          _arguments -S -s \
             '*'{-m+,--message=3D}'[use given note message]:message' \
             '*'{-F+,--file=3D}'[take note message from given file]:note m=
essage file:_files' \
             '(-C --reuse-message)'{-C+,--reuse-message=3D}'[take note mes=
sage from given blob object]: :__git_blobs' \
@@ -1259,9 +1305,12 @@ _git-pull () {
     $merge_options \
     '(-r --rebase --no-rebase)'{-r=3D-,--rebase=3D-}'[perform a rebase af=
ter fetching]::rebase after fetching:((true\:"rebase after fetching"
                                                                          =
                               false\:"merge after fetching"
-                                                                         =
                               preserve\:"rebase and preserve merges"))' \
+                                                                         =
                               preserve\:"rebase and preserve merges"
+													interactive\:"allow list of commits to be edited"))' \
     '(-r --rebase            )--no-rebase[do not perform a rebase after f=
etching]' \
+    '--autostash[automatically stash/stash pop before and after rebase]' =
\
     $fetch_options \
+    '(--no-tags -t --tags)--no-tags[disable automatic tag following]' \
     ': :__git_any_repositories' \
     '*: :__git_ref_specs_fetchy'
 }
@@ -1269,11 +1318,17 @@ _git-pull () {
 (( $+functions[_git-push] )) ||
 _git-push () {
   local ret=3D1
+  local -a sign
+  sign=3D(
+    {yes,true}'\:always,\ and\ fail\ if\ unsupported\ by\ server'
+    {no,false}'\:never'
+    if-asked'\:iff\ supported\ by\ server'
+  )
   # 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 p=
ath
   # later on to match the remote end.
-  _arguments -w -S -s \
+  _arguments -S -s \
     '--all[push all refs under refs/heads/]' \
     '--prune[remove remote branches that do not have a local counterpart]=
' \
     '--mirror[push all refs under refs/heads/ and refs/tags/ and delete n=
on-existing refs]' \
@@ -1293,12 +1348,14 @@ _git-push () {
     '(-q --quiet -v --verbose --progress)'{-q,--quiet}'[suppress all outp=
ut]' \
     '(-q --quiet -v --verbose)'{-v,--verbose}'[output additional informat=
ion]' \
     '(-q --quiet)--progress[output progress information]' \
-    '(--verify)--no-verify[bybass the pre-push hook]' \
-    '--recurse-submodules=3D[submodule handling]:submodule handling:((che=
ck\:"refuse pushing of supermodule if submodule commit cannot be found on =
the remote"
-                                                                    on-de=
mand\:"push all changed submodules"))' \
-    '(--no-signed --signed)--sign=3D[GPG sign the push]:signing enabled:(=
yes no if-asked)' \
+    '(--verify)--no-verify[bypass the pre-push hook]' \
+    '--recurse-submodules=3D[submodule handling]:submodule handling:((
+        check\:"refuse to push if submodule commit not to be found on rem=
ote"
+        on-demand\:"push all changed submodules"
+	no\:"no submodule handling"))' \
+    "(--no-signed --signed)--sign=3D-[GPG sign the push]::signing enabled=
:(($^^sign))" \
     '(--no-signed --sign)--signed[GPG sign the push]' \
-    "(--sign --sign)--no-signed[don't GPG sign the push]" \
+    "(--sign --signed)--no-signed[don't GPG sign the push]" \
     '--atomic[request atomic transaction on remote side]' \
     '(-4 --ipv4 -6 --ipv6)'{-4,--ipv4}'[use IPv4 addresses only]' \
     '(-4 --ipv4 -6 --ipv6)'{-6,--ipv6}'[use IPv6 addresses only]' \
@@ -1336,10 +1393,9 @@ _git-rebase () {
     '(-)--edit-todo[edit interactive instruction sheet in an editor]' \
     '(-)--skip[skip the current patch]' \
     - options \
-    "--keep-empty[keep empty commits in the result]" \
     '(-m --merge)'{-m,--merge}'[use merging strategies to rebase]' \
     '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=3D-}'[GPG-sign the com=
mit]::key id' \
-    '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commi=
t]' \
+    "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit=
]" \
     '*'{-s+,--strategy=3D}'[use given merge strategy]:merge strategy:__gi=
t_merge_strategies' \
     '*'{-X+,--strategy-option=3D}'[pass merge-strategy-specific option to=
 merge strategy]:option' \
     '(-q --quiet -v --verbose --stat -n --no-stat)'{-q,--quiet}'[suppress=
 all output]' \
@@ -1354,10 +1410,12 @@ _git-rebase () {
     '(-i --interactive --ignore-whitespace --whitespace --committer-date-=
is-author-date)'{-i,--interactive}'[make a list of commits to be rebased a=
nd open in $EDITOR]' \
     '(-p --preserve-merges --interactive)'{-p,--preserve-merges}'[try to =
recreate merges instead of ignoring them]' \
     {-x+,--exec=3D}'[with -i\: append "exec <cmd>" after each line]:comma=
nd:_command_names -e' \
+    '(-k --keep-empty)'{-k,--keep-empty}'[keep empty commits in the resul=
t]' \
     '(1)--root[rebase all reachable commits]' \
     $autosquash_opts \
     '(--autostash --no-autostash)--autostash[stash uncommitted changes be=
fore rebasing and apply them afterwards]' \
     '(--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]' \
     '--no-ff[cherry-pick all rebased commits with --interactive, otherwis=
e synonymous to --force-rebase]' \
     '--onto=3D[start new branch with HEAD equal to given revision]:newbas=
e:__git_revisions' \
@@ -1370,16 +1428,15 @@ _git-reset () {
   local curcontext=3D$curcontext state line ret=3D1
   typeset -A opt_args
 =

-  _arguments -w -C -s \
+  _arguments -C -s -S \
       '(       --mixed --hard --merge --keep -p --patch -- *)--soft[do no=
t touch the index file nor the working tree]' \
       '(--soft         --hard --merge --keep -p --patch -- *)--mixed[rese=
t the index but not the working tree (default)]' \
-      '(--soft         --hard --merge --keep -p --patch -- *)-N[keep --in=
tent-to-add entries in the index]' \
+      '(--soft         --hard --merge --keep -p --patch -- *)'{-N,--inten=
t-to-add}'[record only the fact that removed paths will be added later]' \
       '(--soft --mixed        --merge --keep -p --patch -- *)--hard[match=
 the working tree and index to the given tree]' \
       '(--soft --mixed --hard         --keep -p --patch -- *)--merge[rese=
t out of a conflicted merge]' \
       '(--soft --mixed --hard --merge        -p --patch -- *)--keep[like =
--hard, but keep local working tree changes]' \
       '(-p --patch)'{-p,--patch}'[select diff hunks to remove from the in=
dex]' \
       '(-q --quiet)'{-q,--quiet}'[suppress all output]' \
-      '(- 1)--[start file arguments]' \
       '(--soft --mixed --hard --merge --keep):: :__git_commits' \
       '(--soft --mixed --hard --merge --keep)*:: :->file' && ret=3D0
 =

@@ -1397,19 +1454,20 @@ _git-reset () {
 =

 (( $+functions[_git-revert] )) ||
 _git-revert () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(- :)--quit[end revert or cherry-pick sequence]' \
     '(- :)--continue[resume revert or cherry-pick sequence]' \
     '(- :)--abort[cancel revert or cherry-pick sequence]' \
     '(-e --edit --no-edit)'{-e,--edit}'[edit the commit before committing=
 the revert]' \
     '(-e --edit --no-edit)--no-edit[do not edit the commit message before=
 committing the revert]' \
     '(-m --mainline)'{-m+,--mainline=3D}'[pick which parent is mainline]:=
parent number' \
+    '--rerere-autoupdate[update the index with reused conflict resolution=
 if possible]' \
     '(-n --no-commit)'{-n,--no-commit}'[do not commit the reversion]' \
     '(-s --signoff)'{-s,--signoff}'[add Signed-off-by line at the end of =
the commit message]' \
     '--strategy=3D[use given merge strategy]:merge strategy:__git_merge_s=
trategies' \
     '*'{-X,--strategy-option=3D}'[pass merge-strategy-specific option to =
merge strategy]:option' \
     '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=3D-}'[GPG-sign the com=
mit]::key id' \
-    '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commi=
t]' \
+    "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit=
]" \
     ': :__git_commits'
 }
 =

@@ -1418,13 +1476,13 @@ _git-rm () {
   local curcontext=3D$curcontext state line ret=3D1
   declare -A opt_args
 =

-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '(-f --force)'{-f,--force}'[override the up-to-date check]' \
     '(-n --dry-run)'{-n,--dry-run}'[do not actually remove the files, jus=
t show if they exist in the index]' \
     '-r[allow recursive removal when a leading directory-name is given]' =
\
     '--cached[only remove files from the index]' \
     '--ignore-unmatch[exit with 0 status even if no files matched]' \
-    '(-q --quiet)'{-q,--quiet}'[suppress all output]' \
+    '(-q --quiet)'{-q,--quiet}"[don't list removed files]" \
     '*:: :->file' && ret=3D0
 =

   case $state in
@@ -1446,7 +1504,7 @@ _git-shortlog () {
 =

   # TODO: should take all arguments found in setup_revisions() (probably =
more
   # or less what git-rev-list takes).
-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '(: -)'{-h,--help}'[print a short usage message and exit]' \
     '(-n --numbered)'{-n,--numbered}'[sort according to number of commits=
]' \
     '(-s --summary)'{-s,--summary}'[suppress commit description]' \
@@ -1508,9 +1566,10 @@ _git-show () {
   __git_setup_log_options
   __git_setup_revision_options
 =

-  _arguments -w -C -s \
+  _arguments -C -s \
     $log_options \
     $revision_options \
+    '(-q --quiet)'{-q,--quiet}'[suppress diff output]' \
     '*:: :->object' && ret=3D0
 =

   case $state in
@@ -1530,15 +1589,24 @@ _git-show () {
 _git-stash () {
   local curcontext=3D$curcontext state line ret=3D1
   declare -A opt_args
+  local -a save_arguments
+
+  save_arguments=3D(
+    '(-p --patch -a --all -u --include-untracked)'{-p,--patch}'[interacti=
vely select hunks from diff between HEAD and working tree to stash]'
+    '(-k --keep-index --no-keep-index)'{-k,--keep-index}'[all changes alr=
eady added to the index are left intact]'
+    '(-k --keep-index)--no-keep-index[all changes already added to the in=
dex are undone]'
+    '(-q --quiet)'{-q,--quiet}'[suppress all output]'
+    '(-p --patch -a --all -u --include-untracked)'{-u,--include-untracked=
}'[include untracked files]'
+    '(-p --patch -a --all -u --include-untracked)'{-a,--all}'[include ign=
ored files]'
+  )
 =

   _arguments -C \
-    ': :->command' \
-    '*:: :->option-or-argument' && ret=3D0
+    '*::: :->args' \
+    ${save_arguments//#\(/(* } && ret=3D0
 =

-  case $state in
-    (command)
+  if [[ -n $state ]]; then
+    if (( CURRENT =3D=3D 1 )); then
       local -a commands
-      local -a save_arguments
 =

       commands=3D(
         save:'save your local modifications to a new stash'
@@ -1549,24 +1617,16 @@ _git-stash () {
         branch:'branch off at the commit at which the stash was originall=
y created'
         clear:'remove all the stashed states'
         drop:'remove a single stashed state from the stash list'
-        create:'create a stash without storing it in the ref namespace')
-
-      save_arguments=3D(
-        '(--keep-index)--patch[interactively select hunks from diff betwe=
en HEAD and working tree to stash]' \
-          '(             --no-keep-index)--keep-index[all changes already=
 added to the index are left intact]' \
-          '(--keep-index                )--no-keep-index[all changes alre=
ady added to the index are undone]' \
-          '(-q --quiet)'{-q,--quiet}'[suppress all output]' \
-          '(-u --include-untracked)'{-u,--include-untracked}'[include unt=
racked files]' \
+        create:'create a stash without storing it in the ref namespace'
       )
+
       _describe -t commands command commands && ret=3D0
-      _arguments -S $save_arguments && ret=3D0  # "stash" defaults to "sa=
ve", but without "message".
-      ;;
-    (option-or-argument)
+    else
       curcontext=3D${curcontext%:*}-$line[1]:
+      compset -n 1
 =

       case $line[1] in
         (save)
-          _arguments -S $save_arguments && ret=3D0
           _arguments -S \
             $save_arguments \
             ':: :_guard "([^-]?#|)" message' && ret=3D0
@@ -1576,7 +1636,7 @@ _git-stash () {
           __git_setup_log_options
           __git_setup_revision_options
 =

-          _arguments -s -w \
+          _arguments -s \
             $log_options \
             $revision_options && ret=3D0
           ;;
@@ -1584,7 +1644,7 @@ _git-stash () {
           local diff_options
           __git_setup_diff_options
 =

-          _arguments -S -s -w \
+          _arguments -S -s \
             $diff_options \
             ':: :__git_stashes' && ret=3D0
           ;;
@@ -1614,8 +1674,8 @@ _git-stash () {
           _nothing
           ;;
       esac
-      ;;
-  esac
+    fi
+  fi
 =

   return ret
 }
@@ -1628,8 +1688,8 @@ _git-status () {
     branch_opts=3D('(-b --branch)'{-b,--branch}'[show branch and tracking=
 info]')
   fi
 =

-  _arguments -w -S -s \
-    '(-s --short)'{-s,--short}'[output in short format]' \
+  _arguments -S -s \
+    '(-s --short --column --no-column)'{-s,--short}'[output in short form=
at]' \
     $branch_opts \
     '(-s --short)--porcelain[produce machine-readable output]' \
     '(-u --untracked-files)'{-u-,--untracked-files=3D-}'[show untracked f=
iles]::mode:((no\:"show no untracked files" \
@@ -1637,8 +1697,8 @@ _git-status () {
                                                                          =
            all\:"also show untracked files in untracked directories (defa=
ult)"))' \
     '--ignore-submodules[ignore changes to submodules]:: :__git_ignore_su=
bmodules_whens' \
     '--ignored[show ignored files as well]' \
-    '(--porcelain)-z[use NUL termination on output]' \
-    '(--no-column)--column=3D-[display in columns]::column.status option:=
((always\:"always show in columns" never\:"never show in columns" auto\:"s=
how in columns if the output is to the terminal" column\:"fill columns bef=
ore rows (default)" row\:"fill rows before columns" plain\:"show in one co=
lumn" dense\:"make unequal size columns to utilize more space" nodense\:"m=
ake equal size columns"))' \
+    '(-z --null --column --no-column)'{-z,--null}'[use NUL termination on=
 output]' \
+    '(--no-column -z --null)--column=3D-[display in columns]::column.stat=
us option:((always\:"always show in columns" never\:"never show in columns=
" auto\:"show in columns if the output is to the terminal" column\:"fill c=
olumns before rows (default)" row\:"fill rows before columns" plain\:"show=
 in one column" dense\:"make unequal size columns to utilize more space" n=
odense\:"make equal size columns"))' \
     '(--column)--no-column[do not display in columns]' \
     '*: :__git_ignore_line_inside_arguments _files'
 }
@@ -1700,6 +1760,7 @@ _git-submodule () {
         (deinit)
           _arguments -S \
             '(-f --force)'{-f,--force}'[remove submodule worktree even if=
 local modifications are present]' \
+	    '(*)--all[remove all submodules]' \
             '*: :__git_ignore_line_inside_arguments __git_submodules' && =
ret=3D0
           ;;
         (update)
@@ -1707,8 +1768,9 @@ _git-submodule () {
           _arguments -S \
             '(-q --quiet)'{-q,--quiet}'[suppress all output]' \
             '(-N --no-fetch)'{-N,--no-fetch}'[do not fetch new objects fr=
om repository]' \
-            '--merge[merge commit recorded in superproject into current b=
ranch of submodule]' \
-            '--rebase[rebase current branch onto commit recorded in super=
project]' \
+	    '(--merge --rebase)--checkout[checkout commit recorded in the superp=
roject in the submodule on a detached HEAD]' \
+	    '(--checkout --rebase)--merge[merge commit recorded in superproject =
into current branch of submodule]' \
+	    '(--checkout --merge)--rebase[rebase current branch onto commit reco=
rded in superproject]' \
             '--reference=3D[remote repository to clone]: :__git_any_repos=
itories' \
             '--recursive[traverse submodules recursively]' \
             '--remote[use the status of the submodule''s remote-tracking =
branch]' \
@@ -1719,8 +1781,8 @@ _git-submodule () {
         (summary)
           _arguments -C -A '-*' \
             '(-q --quiet)'{-q,--quiet}'[suppress all output]' \
-            '--cached[use commit stored in the index]' \
-            '--files[compare commit in index with submodule HEAD commit]'=
 \
+            '(--files)--cached[use commit stored in the index]' \
+            '(--cached)--files[compare commit in index with submodule HEA=
D commit]' \
             '(-n --summary-limit)'{-n,--summary-limit=3D}'[limit summary =
size]: :__git_guard_number "limit"' \
             '(-)--[start submodule arguments]' \
             '*:: :->commit-or-submodule' && ret=3D0
@@ -1829,14 +1891,15 @@ _git-subtree () {
 	;;
         (split)
           _arguments -S \
+	    '--annotate[add a prefix to commit message of new commits]:prefix' \
             '(-q --quiet)'{-q,--quiet}'[suppress progress output]' \
-            '(-P --prefix)'{-P+,--prefix=3D}'[the path to the subtree in =
the repository to manipulate]: :_directories' \
+            '(-P --prefix)'{-P+,--prefix=3D}'[specify path to the subtree=
 in the repository to manipulate]: :_directories' \
             '(-b --branch)'{-b,--branch=3D}'[create a new branch]' \
             '--onto=3D[try connecting new tree to an existing one]: :__gi=
t_ref_specs' \
-            '(-m --message)'{-m+,--message=3D}'[use the given message as =
the commit message for the merge commit]:message' \
+            '(-m --message)'{-m+,--message=3D}'[specify commit message fo=
r the merge]:message' \
             '--ignore-joins[ignore prior --rejoin commits]' \
             '--onto=3D[try connecting new tree to an existing one]: :__gi=
t_ref_specs' \
-            '--rejoin[use the given message as the commit message for the=
 merge commit]' \
+            '--rejoin[merge the new branch back into HEAD]' \
             '*: :__git_references' && ret=3D0
 	;;
         (*)
@@ -1865,13 +1928,14 @@ _git-tag () {
       '(-a --annotate -s --sign -u --local-user)'{-a,--annotate}'[create =
an unsigned, annotated tag]' \
       '(-a --annotate -s --sign -u --local-user)'{-s,--sign}'[create an s=
igned and annotated tag]' \
       '(-a --annotate -s --sign)'{-u+,--local-user=3D}'[create a tag, ann=
otated and signed with the given key]: :__git_gpg_secret_keys' \
-      '-f[replace existing tag]' \
+      '(-f --force)'{-f,--force}'[replace existing tag]' \
+      '--create-reflog[create a reflog]' \
       '--cleanup=3D[cleanup message]:mode:((verbatim\:"no cleanup" whites=
pace\:"remove leading and trailing whitespace" strip\:"remove leading and =
trailing whitespace and comments"))' \
       $message_opts \
       ': :__git_tags' \
       ':: :__git_commits' \
     - deletion \
-      '-d[delete tags]' \
+      '(-d --delete)'{-d,--delete}'[delete tags]' \
       '*:: :__git_ignore_line_inside_arguments __git_tags' \
     - listing \
       '-n+[limit line output of annotation]: :__git_guard_number "limit"'=
 \
@@ -1879,15 +1943,70 @@ _git-tag () {
       '(--no-column)--column=3D-[display tag listing in columns]::column.=
tag option:((always\:"always show in columns" never\:"never show in column=
s" auto\:"show in columns if the output is to the terminal" column\:"fill =
columns before rows (default)" row\:"fill rows before columns" plain\:"sho=
w 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=3D[only list tags which contain the specified commit]: =
:__git_commits' \
-      '--points-at=3D[only list tags of the given object]: :__git_commits=
' \
+      '--merged=3D-[print only tags that are merged]:: :__git_commits' \
+      '--no-merged=3D-[print only tags that are not merged]:: :__git_comm=
its' \
       '--sort=3D[specify how the tags should be sorted]:mode:((refname\:"=
lexicographic order"
                                                              version\\\:r=
efname\:"tag names are treated as version numbers"))' \
+      '--points-at=3D[only list tags of the given object]: :__git_commits=
' \
+      '--format=3D[specify format to use for the output]' \
       '::pattern' \
     - verification \
-      '-v[verifies gpg signutare of tags]' \
+      '(-v --verify)'{-v,--verify}'[verify gpg signutare of tags]' \
       '*:: :__git_ignore_line_inside_arguments __git_tags'
 }
 =

+(( $+functions[_git-worktree] )) ||
+_git-worktree() {
+  local curcontext=3D"$curcontext" state state_descr line ret=3D1
+  declare -A opt_args
+
+  _arguments -C \
+    ': :->command' \
+    '*::: :=3D ->option-or-argument' && ret=3D0
+
+  case $state in
+    (command)
+      declare -a commands args
+
+      commands=3D(
+        add:'create a new working tree'
+        prune:'prune working tree information'
+        list:'list details of each worktree'
+      )
+
+      _describe -t commands command commands && ret=3D0
+    ;;
+    (option-or-argument)
+      curcontext=3D${curcontext%:*}-$line[1]:
+      case $line[1] in
+        (add)
+	  if (( $words[(I)--detach] )); then
+	    args=3D( ':commit:__git_commits' )
+	  else
+	    args=3D( ':branch:__git_branch_names' )
+	  fi
+          _arguments \
+	    '(-f --force)'{-f,--force}'[checkout branch even if already checked =
out in another worktree]' \
+	    '(-B --detach)-b+[create a new branch]: :__git_branch_names' \
+	    '(-b --detach)-B+[create or reset a branch]: :__git_branch_names' \
+	    '(-b -B)--detach[detach HEAD at named commit]' \
+	    ':path:_files' $args && ret=3D0
+	;;
+        (prune)
+          _arguments \
+	    '(-n --dry-run)'{-n,--dry-run}"[don't remove, show only]" \
+	    '(-v --verbose)'{-v,--verbose}'[report pruned objects]' \
+	    '--expire[expire objects older than specified time]:time' && ret=3D0
+	;;
+        (list)
+	  _arguments '--porcelain[machine-readable output]' && ret=3D0
+	;;
+      esac
+    ;;
+  esac
+  return ret
+}
+
 (( $+functions[_gitk] )) ||
 _gitk () {
   _git-log
@@ -1926,35 +2045,39 @@ _git-config () {
     value_arg=3D': :->value'
   fi
 =

-  _arguments -w -C -S -s \
-    '(         --system --local -f --file)--global[use user-global config=
 file]' \
-    '(--global          --local -f --file)--system[use system-wide config=
 file]' \
-    '(--global --system         -f --file)--local[use local config file]'=
 \
-    '(--global --system -f --file)'{-f+,--file=3D}'[use given config file=
]:config file:_files' \
+  _arguments -C -S -s \
+    '(         --system --local -f --file --blob)--global[use user-global=
 config file]' \
+    '(--global          --local -f --file --blob)--system[use system-wide=
 config file]' \
+    '(--global --system         -f --file --blob)--local[use local config=
 file]' \
+    '(--global --system --local           --blob)'{-f+,--file=3D}'[use gi=
ven config file]:config file:_files' \
+    '(--global --system --local -f --file)--blob=3D[read config from give=
n blob object]:blob:__git_blobs' \
     '(       --int --bool-or-int --path)--bool[setting is a boolean]' \
     '(--bool       --bool-or-int --path)--int[setting is an integer]' \
     '(--bool --int               --path)--bool-or-int[setting is an integ=
er]' \
     '(--bool --int --bool-or-int       )--path[setting is a path]' \
     '(-z --null)'{-z,--null}'[end values with NUL and newline between key=
 and value]' \
+    '(--get --get-all --get-urlmatch --replace-all --add --unset --unset-=
all --rename-section --remove-section -e --edit --get-color --get-colorboo=
l)--name-only[show variable names only]' \
+    '(--includes)'--no-includes"[don't respect \"include.*\" directives]"=
 \
+    '(--no-includes)'--includes'[respect "include.*" directives in config=
 files when looking up values]' \
+    '(--global --system --local -f --file --blob --get-urlmatch --replace=
-all --add --unset --unset-all --rename-section --remove-section -e --edit=
 --get-color --get-colorbool)--show-origin[show origin of config]' \
     $name_arg \
     $value_arg \
     '::value regex' \
     - '(actions)' \
-      '(-z --null)--replace-all[replace all values of the given key]' \
-      '(3 -z --null)--add[add new value without altering any existing one=
s]' \
-      '(2)--get[get the first matching value of the key]' \
-      '(2)--get-all[get all matching values of the key]' \
-      '(3 --bool --int --bool-or-int --path -z --null)--remove-section[re=
move the given section]' \
-      '(3 --bool --int --bool-or-int --path -z --null)--rename-section[re=
name the given section]'  \
-      '(2 --bool --int --bool-or-int --path -z --null)--unset[remove the =
first matching value of the key]' \
-      '(2 --bool --int --bool-or-int --path -z --null)--unset-all[remove =
all matching values of the key]' \
-      '(: --bool --int --bool-or-int --path)'{-l,--list}'[list all variab=
les set in config file]' \
+      '(2 --name-only)--get[get the first matching value of the key]' \
+      '(2 --name-only)--get-all[get all matching values of the key]' \
       '(2)--get-regexp[like "--get-all", but interpret "name" as a regula=
r expression]' \
-      '(2 3 --bool --int --bool-or-int --path -z --null)--get-colorbool[c=
heck if color should be used]: :->gettable-colorbool-option' \
-      '(2 3 --bool --int --bool-or-int --path -z --null)--get-color[find =
color setting]: :->gettable-color-option' \
-      '(-e --edit --bool --int --bool-or-int --path -z --null)'{-e,--edit=
}'[open config file for editing]' \
-      '(--no-includes)'--includes'[respect "include.*" directives in conf=
ig files when looking up values]' \
-      '(--includes)'--no-includes'[do not respect "include.*" directives]=
' && ret=3D0
+      '(--name-only --show-origin)--get-urlmatch[get value specific for t=
he URL]' \
+      '(-z --null --name-only --show-origin)--replace-all[replace all val=
ues of the given key]' \
+      '(3 -z --null --name-only --show-origin)--add[add new value without=
 altering any existing ones]' \
+      '(2 --bool --int --bool-or-int --path -z --null --name-only --show-=
origin)--unset[remove the first matching value of the key]' \
+      '(2 --bool --int --bool-or-int --path -z --null --name-only --show-=
origin)--unset-all[remove all matching values of the key]' \
+      '(3 --bool --int --bool-or-int --path -z --null --name-only --show-=
origin)--rename-section[rename the given section]'  \
+      '(3 --bool --int --bool-or-int --path -z --null --name-only --show-=
origin)--remove-section[remove the given section]' \
+      '(: --bool --int --bool-or-int --path)'{-l,--list}'[list all variab=
les set in config file]' \
+      '(-e --edit --bool --int --bool-or-int --path -z --null --name-only=
 --show-origin)'{-e,--edit}'[open config file for editing]' \
+      '(2 3 --bool --int --bool-or-int --path -z --null --name-only --sho=
w-origin)--get-color[find color setting]: :->gettable-color-option' \
+      '(2 3 --bool --int --bool-or-int --path -z --null --name-only --sho=
w-origin)--get-colorbool[check if color should be used]: :->gettable-color=
bool-option' && ret=3D0
 =

   # TODO: Add support for merge.*. (merge driver), diff.*. (diff driver),=
 and filter.*. (filter driver) options
   # (see gitattributes(5)).
@@ -3107,7 +3230,7 @@ _git-config () {
 (( $+functions[_git-fast-export] )) ||
 _git-fast-export () {
   # TODO: * should be git-rev-arg and git-rev-list arguments.
-  _arguments -w -S -s \
+  _arguments -S -s \
     '--progress=3D[insert progress statements]: :__git_guard_number inter=
val' \
     '--signed-tags=3D[specify how to handle signed tags]:action:((verbati=
m\:"silently export"
                                                                 warn\:"ex=
port, but warn"
@@ -3126,6 +3249,9 @@ _git-fast-export () {
     '--use-done-feature[start with a "feature done" stanza, and terminate=
 with a "done" command]' \
     '--no-data[do not output blocb objects, instead referring to them via=
 their SHA-1 hash]' \
     '--full-tree[output full tree for each commit]' \
+    '(--get --get-all)--name-only[show variable names only]' \
+    '*--refspec=3D[apply refspec to exported refs]:refspec' \
+    '--anonymize[anonymize output]' \
     '*: :__git_commit_ranges'
 }
 =

@@ -3138,8 +3264,8 @@ _git-fast-import () {
                                                            now\:"use curr=
ent time and timezone"' \
     '--done[terminate with error if there is no "done" command at the end=
 of the stream]' \
     '--force[force updating modified existing branches]' \
-    '--max-pack-size=3D-[maximum size of each packfile]: :__git_guard_byt=
es' \
-    '--big-file-threshold=3D-[maximum size of blob to create deltas for]:=
 :__git_guard_bytes' \
+    '--max-pack-size=3D-[maximum size of each packfile]: : __git_guard_by=
tes' \
+    '--big-file-threshold=3D-[maximum size of blob to create deltas for]:=
 : __git_guard_bytes' \
     '--depth=3D-[maximum delta depth for blob and tree deltification]: :_=
_git_guard_number "maximum delta depth"' \
     '--active-branches=3D-[maximum number of branches to maintain active =
at once]: :__git_guard_number "maximum number of branches"' \
     '--export-marks=3D-[dump internal marks table when complete]: :_files=
' \
@@ -3199,7 +3325,7 @@ _git-prune () {
     '(-n --dry-run)'{-n,--dry-run}'[do not remove anything; just report w=
hat would be removed]' \
     '(-v --verbose)'{-v,--verbose}'[report all removed objects]' \
     '--progress[show progress]' \
-    '--expire[only expire loose objects older than given date]: :__git_da=
tetimes' \
+    '--expire=3D[only expire loose objects older than specified date]: :_=
_git_datetimes' \
     '*:: :__git_heads'
 }
 =

@@ -3230,7 +3356,9 @@ _git-reflog () {
         commands=3D(
           'expire:prune old reflog entries'
           'delete:delete entries from reflog'
-          'show:show log of ref')
+          'show:show log of ref'
+          'exists:check whether a ref has a reflog'
+	)
 =

         _alternative \
           'commands:: _describe -t commands command commands' \
@@ -3258,6 +3386,7 @@ _git-reflog () {
               '(-n --dry-run)'{-n,--dry-run}'[undocumented]' \
               '--updateref[update ref with SHA-1 of top reflog entry afte=
r expiring or deleting]' \
               '--rewrite[adjust reflog entries to ensure old SHA-1 points=
 to new SHA-1 of previous entry after expiring or deleting]' \
+              '--verbose[output additional information]' \
               '*:: :->reflog-entry' && ret=3D0
 =

             case $state in
@@ -3272,6 +3401,9 @@ _git-reflog () {
               $revision_options \
               ':: :__git_references' && ret=3D0
             ;;
+	  (exists)
+	    __git_references && ret=3D0
+	    ;;
         esac
     esac
 =

@@ -3305,14 +3437,16 @@ _git-remote () {
 =

       commands=3D(
         'add:add a new remote'
+	'get-url:retrieves the URLs for a remote'
         'rename:rename a remote and update all associated tracking branch=
es'
-        'rm:remove a remote and all associated tracking branches'
+	{rm,remove}':remove a remote and all associated tracking branches'
         'set-head:set or delete default branch for a remote'
         'set-branches:change list of branches tracked by a remote'
         'set-url:change URL for a remote'
         'show:show information about a given remote'
         'prune:delete all stale tracking branches for a remote'
-        'update:fetch updates for a set of remotes')
+        'update:fetch updates for a set of remotes'
+      )
 =

       _describe -t commands command commands && ret=3D0
       ;;
@@ -3322,7 +3456,7 @@ _git-remote () {
       case $line[1] in
         (add)
           # TODO: -t and --track should really list branches at url.
-          _arguments -w -S -s \
+          _arguments -S -s \
             '(-f --fetch)'{-f,--fetch}'[run git fetch on new remote after=
 it has been created]' \
             '(       --no-tags)--tags[tell git fetch to import every tag =
from remote repository]' \
             '(--tags          )--no-tags[tell git fetch to not import eve=
ry tag from remote repository]' \
@@ -3340,18 +3474,20 @@ _git-remote () {
 	    ;;
 	  esac
           ;;
+        (get-url)
+          _arguments -S -s \
+            '--push[list push URL instead of fetch URL]' \
+            '--all[list all URLs for the remote]' \
+            ': :__git_remotes' && ret=3D0
+          ;;
         (rename)
           _arguments \
             ':old name:__git_remotes' \
             ':new name:__git_remotes' && ret=3D0
           ;;
-        (rm)
-          _arguments \
-            ': :__git_remotes' && ret=3D0
-          ;;
         (set-head)
           # TODO: Second argument should be a branch at url for remote.
-          _arguments -w -S -s \
+          _arguments -S -s \
             '(- 2)'{-d,--delete}'[delete default branch]' \
             '(- 2)'{-a,--auto}'[determine default branch automatically]' =
\
             ': :__git_remotes' \
@@ -3359,14 +3495,14 @@ _git-remote () {
           ;;
         (set-branches)
           # TODO: Branches should be at url.
-          _arguments -w -S -s \
+          _arguments -S -s \
             '--add[add branches to those already defined]' \
             ': :__git_remotes' \
             '*: :__git_branch_names' && ret=3D0
           ;;
         (set-url)
           # TODO: Old URL should be one of those defined for the remote.
-          _arguments -w -S -s \
+          _arguments -S -s \
             '(3)--push[manipulate push URLs instead of fetch URLs]' \
             '--add[add URL to those already defined]' \
             '(3)--delete[delete all matching URLs]' \
@@ -3375,20 +3511,23 @@ _git-remote () {
             ':old url:_urls' && ret=3D0
           ;;
         (show)
-          _arguments -w -S -s \
+          _arguments -S \
             '-n[do not contact the remote for a list of branches]' \
             '*: :__git_remotes' && ret=3D0
           ;;
         (prune)
-          _arguments -w -S -s \
+          _arguments -S -s \
             '(-n --dry-run)'{-n,--dry-run}'[do not actually prune, only l=
ist what would be done]' \
             '*: :__git_remotes' && ret=3D0
           ;;
         (update)
-          _arguments -w -S -s \
+          _arguments -S -s \
             '(-p --prune)'{-p,--prune}'[prune all updated remotes]' \
             ': :__git_remote-groups' && ret=3D0
           ;;
+	(*) # rm, remove and fallback for any new subcommands
+	  __git_remotes && ret=3D0
+	  ;;
       esac
       ;;
   esac
@@ -3399,32 +3538,39 @@ _git-remote () {
 (( $+functions[_git-repack] )) ||
 _git-repack () {
   # TODO: --quiet is undocumented.
-  _arguments -w -S -s \
+  _arguments -s \
     '(-A)-a[pack all objects into a single pack]' \
     '(-a)-A[pack all objects into a single pack, but unreachable objects =
become loose]' \
     '-d[remove redundant packs after packing]' \
-    '-l[pass --local option to git pack-objects]' \
+    "--unpack-unreachable=3D[with -A, don't loosen objects older than spe=
cified date]:date" \
     '-f[pass --no-reuse-delta option to git pack-objects]' \
     '-F[pass --no-reuse-object option to git pack-objects]' \
+    "-n[don't update server information]" \
     '(-q --quiet)'{-q,--quiet}'[pass -q option to git pack-objects]' \
-    '-n[do not update server information]' \
-    '--window=3D-[number of objects to consider when doing delta compress=
ion]: :__git_guard_number "number of objects"' \
-    '--depth=3D-[maximum delta depth]: :__git_guard_number "maximum delta=
 depth"' \
-    '--window-memory=3D-[scale window size dynamically to not use more th=
an N bytes of memory]: :__git_guard_bytes' \
-    '--max-pack-size=3D-[maximum size of each output packfile]:maximum pa=
ck size:__git_guard_bytes'
+    '(-l --local)'{-l,--local}'[pass --local option to git pack-objects]'=
 \
+    '(-b --write-bitmap-index)'{-b,--write-bitmap-index}'[write a bitmap =
index]' \
+    "--unpack-unreachable=3D[with -A, don't loosen objects older than spe=
cified time]:time" \
+    '--window=3D[number of objects to consider when doing delta compressi=
on]:number of objects' \
+    '--window-memory=3D[scale window size dynamically to not use more tha=
n specified amount of memory]: : __git_guard_bytes' \
+    '--depth=3D[maximum delta depth]:maximum delta depth' \
+    '--max-pack-size=3D-[maximum size of each output packfile]: : __git_g=
uard_bytes "maximum pack size"' \
+    '--pack-kept-objects[repack objects in packs marked with .keep]'
 }
 =

 (( $+functions[_git-replace] )) ||
 _git-replace () {
-  _arguments -w -S -s \
-    '--edit[edit existing object as base a starting point]' \
-    '--graft[rewrite the parents of a commit]' \
-    '(- *)-f[overwrite existing replace ref]' \
-    '(- 2)-d[delete existing replace refs]' \
-    '(- : *)-l[list replace refs]:pattern' \
+  _arguments -S -s \
+    '(-d --delete -l --list -g --graft *)'{-f,--force}'[overwrite existin=
g replace ref]' \
+    "(-d --delete -l --list -g --graft 2 *)--raw[don't pretty-print conte=
nts for --edit]" \
+    '(-d --delete -e --edit -g --graft --raw)--format=3D[use specified fo=
rmat]:format:(short medium long)' \
     ': :__git_objects' \
     ':replacement:__git_objects' \
-    '*: :__git_objects'
+    '*: :__git_objects' \
+    - '(actions)' \
+    '(: * --raw -f --force)'{-l,--list}'[list replace refs]:pattern' \
+    {-d,--delete}'[delete existing replace refs]:*:replacement:__git_obje=
cts' \
+    '(* 2 --format)'{-e,--edit}'[edit existing object and replace it with=
 the new one]' \
+    '(--raw --format)'{-g,--graft}'[rewrite the parents of a commit]'
 }
 =

 # Ancillary Commands (Interrogators)
@@ -3438,10 +3584,11 @@ _git-blame () {
   __git_setup_revision_options
 =

   # TODO: Not sure about __git_cached_files.
-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '-b[show blank SHA-1 for boundary commits]' \
     '--root[do not treat root commits as boundaries]' \
     '--show-stats[include additional statistics at the end of blame outpu=
t]' \
+    '--progress[force progress reporting]' \
     '*-L[annotate only the given line range]: :->line-range' \
     '-l[show long rev]' \
     '-t[show raw timestamp]' \
@@ -3496,7 +3643,7 @@ _git-cherry () {
 _git-count-objects () {
   _arguments \
     '(-v --verbose)'{-v,--verbose}'[also report number of in-pack objects=
 and objects that can be removed]' \
-    {-H,--human-readable}'[Print sizes in human readable format]'
+    {-H,--human-readable}'[print sizes in human readable format]'
 }
 =

 (( $+functions[_git-difftool] )) ||
@@ -3517,7 +3664,7 @@ _git-difftool () {
 (( $+functions[_git-fsck] )) ||
 _git-fsck () {
   # TODO: -v is undocumented.
-  _arguments -w -S -s \
+  _arguments -S -s \
     '--unreachable[show objects that are unreferenced in the object datab=
ase]' \
     '(--dangling --no-dangling)--dangling[print dangling objects (default=
)]' \
     '(--dangling --no-dangling)--no-dangling[do not print dangling object=
s]' \
@@ -3526,9 +3673,11 @@ _git-fsck () {
     '--cache[consider objects recorded in the index as head nodes for rea=
chability traces]' \
     '--no-reflogs[do not consider commits referenced only by reflog entri=
es to be reachable]' \
     '--full[check all object directories]' \
+    '--connectivity-only[check only connectivity]' \
     '--strict[do strict checking]' \
     '(-v --verbose)'{-v,--verbose}'[output additional information]' \
     '--lost-found[write dangling objects into .git/lost-found]' \
+    '--progress[show progress]' \
     '*: :__git_objects'
 }
 =

@@ -3539,13 +3688,13 @@ _git-get-tar-commit-id () {
 =

 (( $+functions[_git-help] )) ||
 _git-help () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(         -g --guides -i --info -m --man -w --web)'{-a,--all}'[show =
all available commands]' \
     '(-a --all -g --guides           -m --man -w --web)'{-i,--info}'[show=
 all available commands]' \
     '(-a --all -g --guides -i --info          -w --web)'{-m,--man}'[show =
all available commands]' \
     '(-a --all -g --guides -i --info -m --man         )'{-w,--web}'[show =
all available commands]' \
     '(-g --guides)'{-g,--guides}'[prints a list of useful guides on the s=
tandard output]' \
-    ': :_git_commands'
+    ': : _alternative commands:command:_git_commands "guides:git guides:(=
attributes glossary ignore modules revisions tutorial workflows)"'
 }
 =

 (( $+functions[_git-instaweb] )) ||
@@ -3553,7 +3702,7 @@ _git-instaweb () {
   local curcontext=3D$curcontext state line ret=3D1
   declare -A opt_args
 =

-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '(-l --local)'{-l,--local}'[bind the web server to 127.0.0.1]' \
     '(-d --httpd)'{-d,--httpd=3D}'[HTTP-daemon command-line that will be =
executed]:command line' \
     '(-m --module-path)'{-m,--module-path=3D}'[module path for the Apache=
 HTTP-daemon]:module path:_directories' \
@@ -3594,7 +3743,7 @@ _git-rerere () {
   declare -A opt_args
 =

   # TODO: --rerere-autoupdate is undocumented.
-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '--rerere-autoupdate[register clean resolutions in index]' \
     ': :->command' && ret=3D0
 =

@@ -3636,7 +3785,7 @@ _git-rev-parse () {
       _message 'argument'
     else
       # TODO: Parse option specification?
-      _arguments -w -S -s \
+      _arguments -S -s \
         '(- *)'{-h,--help}'[display usage]' \
         '--keep-dashdash[do not skip first -- option]' \
         '--stop-at-non-option[stop parsing options at first non-option ar=
gument]' \
@@ -3693,7 +3842,7 @@ _git-show-branch () {
   local curcontext=3D$curcontext state line ret=3D1
   declare -A opt_args
 =

-  _arguments -w -C -S -s -A '-*' \
+  _arguments -C -S -s -A '-*' \
     '(--more        --merge-base --independent)--list[do not show any anc=
estry (--more=3D-1)]' \
     - branches \
       '(-r --remotes -a --all)'{-r,--remotes}'[show remote-tracking branc=
hes]' \
@@ -3732,15 +3881,17 @@ _git-show-branch () {
 =

 (( $+functions[_git-verify-commit] )) ||
 _git-verify-commit () {
-  _arguments -w -S -s \
-    '(-v --verbose)'{-v,--verbose}'[print the contents of the commit obje=
ct before validating it]' \
+  _arguments -S -s \
+    '(-v --verbose)'{-v,--verbose}'[print contents of the commit object b=
efore validating it]' \
+    '--raw[print raw gpg status output]' \
     '*: :__git_commits'
 }
 =

 (( $+functions[_git-verify-tag] )) ||
 _git-verify-tag () {
-  _arguments -w -S -s \
-    '(-v --verbose)'{-v,--verbose}'[print the contents of the tag object =
before validating it]' \
+  _arguments -S -s \
+    '(-v --verbose)'{-v,--verbose}'[print contents of the tag object befo=
re validating it]' \
+    '--raw[print raw gpg status output]' \
     '*: :__git_tags'
 }
 =

@@ -3823,7 +3974,7 @@ _git-cvsimport () {
 =

 (( $+functions[_git-cvsserver] )) ||
 _git-cvsserver () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '--base-path[path to prepend to requested CVSROOT]: :_directories' \
     '--strict-paths[do not allow recursing into subdirectories]' \
     '--export-all[do not check for gitcvs.enabled]' \
@@ -3835,7 +3986,11 @@ _git-cvsserver () {
 =

 (( $+functions[_git-imap-send] )) ||
 _git-imap-send () {
-  _message 'no arguments allowed; accepts mailbox file on standard input'
+  _arguments \
+    '--curl[use libcurl to communicate with the IMAP server]' \
+    - '(out)' \
+    {-v,--verbose}'[be more verbose]' \
+    {-q,--quiet}'[be more quiet]'
 }
 =

 (( $+functions[_git-quiltimport] )) ||
@@ -3843,7 +3998,8 @@ _git-quiltimport () {
   _arguments -S \
     '(-n --dry-run)'{-n,--dry-run}'[check patches and warn if they cannot=
 be imported]' \
     '--author[default author name and email address to use for patches]: =
:_email_addresses' \
-    '--patches[set directory containing patches]:patch directory:_directo=
ries'
+    '--patches[set directory containing patches]:patch directory:_directo=
ries' \
+    '--series[specify quilt series file]:series file:_files'
 }
 =

 (( $+functions[_git-request-pull] )) ||
@@ -3861,8 +4017,8 @@ _git-send-email () {
     '--annotate[review and edit each patch before sending it]' \
     '--bcc=3D[Bcc: value for each email]: :_email_addresses' \
     '--cc=3D[starting Cc: value for each email]: :_email_addresses' \
-    '--to-cover[Copy the To: list from the first file to the rest]' \
-    '--cc-cover[Copy the Cc: list from the first file to the rest]' \
+    '--to-cover[copy the To: list from the first file to the rest]' \
+    '--cc-cover[copy the Cc: list from the first file to the rest]' \
     '--compose[edit introductory message for patch series]' \
     '--from=3D[specify sender]:email address:_email_addresses' \
     '--in-reply-to=3D[specify contents of first In-Reply-To header]:messa=
ge-id' \
@@ -3921,150 +4077,127 @@ _git-svn () {
       declare -a commands
 =

       commands=3D(
-        init:'initialize an empty git repository with additional svn data=
'
-        fetch:'fetch revisions from the SVN remote'
-        clone:'same as init, followed by fetch'
-        rebase:'fetch revs from SVN parent of HEAD and rebase current wor=
k on it'
-        dcommit:'commit diffs from given head onto SVN repository'
-        branch:'create a branch in the SVN repository'
-        tag:'create a tag in the SVN repository'
-        log:'output SVN log-messages'
         blame:'show what revision and author last modified each line of a=
 file'
-        find-rev:'output git commit corresponding to the given SVN revisi=
on'\''s hash'
-        set-tree:'commit given commit or tree to SVN repository'
-        create-ignore:'recursively finds the svn:ignore property and crea=
tes .gitignore files'
-        show-ignore:'output corresponding toplevel .gitignore file of svn=
:ignore'
-        mkdirs:'recreate empty directories that Git cannot track'
+        branch:'create a branch in the SVN repository'
+        clone:'same as init, followed by fetch'
         commit-diff:'commit diff of two tree-ishs'
-        info:'show information about a file or directory'
-        proplist:'list the SVN properties stored for a file or directory'
-        propget:'get a given SVN property for a file'
-        show-externals:'show the subversion externals'
+        create-ignore:'recursively finds the svn:ignore property and crea=
tes .gitignore files'
+        dcommit:'commit diffs from given head onto SVN repository'
+        fetch:'fetch revisions from the SVN remote'
+        find-rev:'output git commit corresponding to the given SVN revisi=
on'\''s hash'
         gc:'compress git-svn-related information'
-        reset:'undo effect of fetch back to specific revision')
+        info:'show information about a file or directory'
+        init:'initialize an empty git repository with additional svn data=
'
+        log:'output SVN log-messages'
+        migrate:'migrate configuration/metadata/layout from previous vers=
ions of git-svn'
+        mkdirs:'recreate empty directories that Git cannot track'
+        propget:'get a given SVN property for a file'
+        proplist:'list the SVN properties stored for a file or directory'
+        propset:'set the value of a property on a file or directory - wil=
l be set on commit'
+        rebase:'fetch revs from SVN parent of HEAD and rebase current wor=
k on it'
+        reset:'undo effect of fetch back to specific revision'
+        set-tree:'commit given commit or tree to SVN repository'
+        show-externals:'show the subversion externals'
+        show-ignore:'output svn:ignore in format of a toplevel .gitignore=
 file'
+        tag:'create a tag in the SVN repository'
+      )
 =

       _describe -t commands command commands && ret=3D0
       ;;
     (option-or-argument)
       curcontext=3D${curcontext%:*}-$line[1]:
-
-      declare -a remote_opts fc_opts init_opts cmt_opts opts
-
-      # TODO: --no-auth-cache is undocumented.
-      # TODO: --config-dir is undocumented.
-      remote_opts=3D(
-          '--username=3D[username to use for SVN transport]: :_users'
-          '--ignore-paths[regular expression of paths to not check out]:p=
attern'
-          '--no-auth-cache[undocumented]'
-          '--config-dir=3D[undocumented]:configuration directory:_directo=
ries')
-
-      # TODO: --repack-flags can be improved by actually completing the l=
egal
-      # flags to git-repack.
-      # TODO: --noMetadata is undocumented.
-      # TODO: --useSvmProps is undocumented.
-      # TODO: --useSvnsyncProps is undocumented.
-      # TODO: --log-window-size is undocumented.
-      # TODO: --no-checkout is undocumented.
-      fc_opts=3D(
-        '--localtime[store Git commit times in local timezone]'
-        '--use-log-author[use author from the first From: or Signed-Off-B=
y: line, when fetching into git]'
-        '--add-author-from[when committing to svn, append a From: line ba=
sed on the git commit'\''s author string]'
-        '(                --no-follow-parent)--follow-parent[follow paren=
t commit]'
-        '(--follow-parent                   )--no-follow-parent[do not fo=
llow parent commit]'
-        '(-A --authors-file)'{-A,--authors-file}'[specify author-conversi=
on file]:author-conversion file:_files'
-        '--authors-prog=3D[program used to generate authors]: :_cmdstring=
'
-        '(-q --quiet)'{-q,--quiet}'[make git-svn less verbose]'
-        '--repack=3D[repack files (for given number of revisions)]:: :__g=
it_guard_number "revision limit"'
-        '(--repack-flags --repack-args --repack-opts)'{--repack-flags=3D,=
--repack-args=3D,--repack-opts=3D}'[flags to pass to git-repack]:git-repac=
k flags'
-        '--noMetadata[undocumented]'
-        '--useSvmProps[undocumented]'
-        '--useSvnsyncProps[undocumented]'
-        '--log-window-size=3D[undocumented]'
-        '--no-checkout[undocumented]'
-        $remote_opts)
-
-      init_opts=3D(
-          '(-T --trunk)'{-T-,--trunk=3D}'[set trunk sub-directory]:trunk =
sub-directory:->subdirectory'
-          '(-t --tags)*'{-t-,--tags=3D}'[add tags sub-directory]:tags sub=
-directory:->subdirectory'
-          '(-b --branches)*'{-b-,--branches=3D}'[add branches sub-directo=
ry]:branches sub-directory:->subdirectory'
-          '(-s --stdlayout)'{-s,--stdlayout}'[shorthand for setting trunk=
, tags, branches as relative paths, the SVN default]'
-          '--no-metadata[set svn-remote.*.noMetadata]'
-          '--use-svm-props[set svn-remote.*.useSvmProps]'
-          '--use-svnsync-props[set svn-remote.*.useSvnsyncProps]'
-          '--rewrite-root=3D[set svn-remote.*.rewriteRoot]:new root:_urls=
'
-          '--rewrite-uuid=3D[set svn-remote.*.rewriteUUID]:uuid'
-          '--prefix=3D[prefix to use for names of remotes]:path prefix:_d=
irectories -r ""'
-          '(               --no-minimize-url)--minimize-url[minimize URLs=
]'
-          '(--minimize-url                  )--no-minimize-url[do not min=
imize URLs]'
-          '--shared=3D[share repository amongst several users]:: :__git_r=
epository_permissions'
-          '--template=3D[directory to use as a template for the object da=
tabase]: :_directories'
-          $remote_opts)
-
-      # TODO: -C and --copy-similarity are undocumented.
-      cmt_opts=3D(
-        '--rmdir[remove empty directories from SVN tree after commit]'
-        '(-e --edit)'{-e,--edit}'[edit commit message before committing]'
-        '-l-[limit number of rename/copy targets to run]: :__git_guard_nu=
mber'
-        '--find-copies-harder[try harder to find copies]'
-        '(-C --copy-similarity)'{-C-,--copy-similarity=3D}'[undocumented]=
: :_guard "[[\:digit:\]]#" number')
-
-      if [[ $line[1] =3D=3D (fetch|clone) ]]; then
-        arguments+=3D(
-          '(-r --revision)'{-r,--revision}'[only fetch given revision or =
revision range]: :__git_svn_revisions'
-          ':: :__git_svn-remotes')
-      fi
-
-      if [[ $line[1] =3D=3D (fetch|rebase|dcommit) ]]; then
-        # TODO: --fetch-all and --all are undocumented.
-        opts+=3D(
-          '(--fetch-all --all)'{--fetch-all,--all}'[undocumented]')
-      fi
-
-      if [[ $line[1] =3D=3D (rebase|dcommit) ]]; then
-        opts+=3D(
-          '(-m --merge)'{-m,--merge}'[use merging strategies, if necessar=
y]'
-          '*'{-s,--strategy=3D-}'[use given merge strategy]:merge strateg=
y:__git_merge_strategies')
-      fi
-
-      if [[ $line[1] =3D=3D (rebase|dcommit|branch) ]]; then
-        opts+=3D(
-          '(-n --dry-run)'{-n,--dry-run}'[only display what would be done=
]')
-      fi
-
-      if [[ $line[1] =3D=3D (rebase|dcommit|log) ]]; then
-        opts+=3D(
-          '(-v --verbose)'{-v,--verbose}'[display extra information]')
-      fi
+      declare -a opts
 =

       case $line[1] in
-        (init)
-          opts+=3D(
-            $init_opts)
-          ;;
-        (fetch)
-          opts+=3D(
-            '--parent[fetch only from SVN parent of current HEAD]'
-            $fc_opts)
-          ;;
-        (clone)
-          opts+=3D(
-            $init_opts
-            $fc_opts
-            ':url:_urls'
-            '::directory:_directories')
-          ;;
-        (rebase)
-          opts+=3D(
-            '--local[do not fetch remotely, rebase against the last fetch=
ed commit from SVN]'
-            $fc_opts)
-          ;;
-        (dcommit)
-          arguments+=3D(
-            '--no-rebase[do not rebase or reset after committing]'
-            '--commit-url[commit to a different SVN url]:SVN URL:_url'
-            $fc_opts
-            $cmt_opts)
-          ;;
+        (clone|dcommit|fetch|init|migrate|rebase|set-tree)
+	  # TODO: --ignore-refs is undocumented.
+	  # TODO: --no-auth-cache is undocumented.
+	  # TODO: --config-dir is undocumented.
+	  opts+=3D(
+	    '--config-dir=3D:configuration directory:_directories'
+	    '--ignore-paths[regular expression of paths to not check out]:perl r=
egex'
+	    '--include-paths[regular expression of paths to check out]:perl rege=
x'
+	    '--ignore-refs:ref'
+	    '--no-auth-cache'
+	    '--username=3D[username to use for SVN transport]: :_users'
+	  )
+	;|
+        (clone|dcommit|fetch|log|rebase|set-tree)
+	  opts+=3D(
+	    '(-A --authors-file)'{-A,--authors-file}'[specify author-conversion =
file]:author-conversion file:_files'
+	  )
+	;|
+        (clone|dcommit|fetch|rebase|set-tree)
+	  # TODO: --repack-flags can be improved by actually completing the lega=
l
+	  # flags to git-repack.
+	  # TODO: --no-checkout is undocumented.
+	  opts+=3D(
+	    "--add-author-from[when committing to svn, append a From: line based=
 on the git commit's author string]"
+	    '--authors-prog=3D[specify program used to generate authors]: :_cmds=
tring'
+	    '(--no-follow-parent)--follow-parent[follow parent commit]'
+	    "(--follow-parent)--no-follow-parent[don't follow parent commit]"
+	    '--localtime[store Git commit times in local timezone]'
+	    '--log-window-size=3D[fetch specified number of log entries per-requ=
est]:entries [100]'
+	    '--no-checkout'
+	    '(-q --quiet)'{-q,--quiet}'[make git-svn less verbose]'
+	    '(--repack-flags --repack-args --repack-opts)'{--repack-flags=3D,--r=
epack-args=3D,--repack-opts=3D}'[flags to pass to git-repack]:git-repack f=
lags'
+	    '--repack=3D[repack files (for given number of revisions)]:: :__git_=
guard_number "revision limit"'
+	    '--use-log-author[use author from the first From: or Signed-Off-By: =
line, when fetching into git]'
+	  )
+	;|
+	(clone|init)
+	  opts+=3D(
+	    '(-T --trunk)'{-T-,--trunk=3D}'[set trunk sub-directory]:trunk sub-d=
irectory:->subdirectory'
+	    '(-t --tags)*'{-t-,--tags=3D}'[add tags sub-directory]:tags sub-dire=
ctory:->subdirectory'
+	    '(-b --branches)*'{-b-,--branches=3D}'[add branches sub-directory]:b=
ranches sub-directory:->subdirectory'
+	    '(-s --stdlayout)'{-s,--stdlayout}'[shorthand for setting trunk, tag=
s, branches as relative paths, the SVN default]'
+	    '--no-metadata[get rid of git-svn-id: lines at the end of every comm=
it]'
+	    '--rewrite-root=3D[set svn-remote.*.rewriteRoot]:new root:_urls'
+	    '--rewrite-uuid=3D[set svn-remote.*.rewriteUUID]:uuid'
+	    '--prefix=3D[prefix to use for names of remotes]:path prefix:_direct=
ories -r ""'
+	    '(               --no-minimize-url)--minimize-url[minimize URLs]'
+	    "(--minimize-url                  )--no-minimize-url[don't minimize =
URLs]"
+	    '--shared=3D[share repository amongst several users]:: :__git_reposi=
tory_permissions'
+	    '--template=3D[directory to use as a template for the object databas=
e]: :_directories'
+	    '--use-svm-props[re-map repository URLs and UUIDs from mirrors creat=
ed with SVN::Mirror]'
+	    '--use-svnsync-props[re-map repository URLs and UUIDs from mirrors c=
reated with svnsync]'
+	  )
+	;|
+	(commitdiff|dcommit|set-tree)
+	  # TODO: -C and --copy-similarity are undocumented.
+	  opts+=3D(
+	    '(-C --copy-similarity)'{-C-,--copy-similarity=3D}': :_guard "[[\:di=
git:\]]#" number'
+	    '(-e --edit)'{-e,--edit}'[edit commit message before committing]'
+	    '-l-[limit number of rename/copy targets to run]: :__git_guard_numbe=
r'
+	    '--find-copies-harder[try harder to find copies]'
+	    '--rmdir[remove empty directories from SVN tree after commit]'
+	    ':: :__git_svn-remotes'
+	  )
+	;|
+	(fetch|clone)
+	  opts+=3D(
+	    '(-r --revision)'{-r,--revision}'[only fetch given revision or revis=
ion range]: :__git_svn_revisions'
+	    ':: :__git_svn-remotes'
+	  )
+        ;|
+        (fetch|rebase|dcommit)
+	  # TODO: --fetch-all and --all are undocumented.
+	  opts+=3D( '(--fetch-all --all)'{--fetch-all,--all} )
+        ;|
+        (rebase|dcommit)
+	  opts+=3D(
+	    '(-M -m --merge)'{-M,-m,--merge}'[use merging strategies, if necessa=
ry]'
+	    '*'{-s,--strategy=3D-}'[use given merge strategy]:merge strategy:__g=
it_merge_strategies'
+	  )
+        ;|
+        (rebase|dcommit|branch|tag)
+	  opts+=3D(
+	    '(-n --dry-run)'{-n,--dry-run}'[only display what would be done]'
+	  )
+        ;|
+        (rebase|dcommit|log)
+	  opts+=3D( '(-v --verbose)'{-v,--verbose}'[display extra information]' =
)
+        ;|
         (branch|tag)
           # TODO: -d/--destination should complete output of
           # git config --get-all svn-remote.*.branches
@@ -4074,15 +4207,82 @@ _git-svn () {
           # git config --get-all svn-remote.*.commiturl
           opts+=3D(
             '(-m --message)'{-m,--message}'[specify the commit message]:m=
essage'
-            '(-d --destination)'{-d,--destination}'[location of branch or=
 tag to create in SVN repository]: :_directories'
+            '(-d --destination)'{-d,--destination}"[location of $line[1] =
to create in SVN repository]: :_directories"
             '--username[specify SVN username to perform commit as]: :_use=
rs'
-            '--commit-url[specify URL to connect to destination SVN repos=
itory]: :_urls')
+            '--commit-url[specify URL to connect to destination SVN repos=
itory]: :_urls'
+	    '--parents[create parent folders]'
+	  )
+	;|
+        (commit-diff|create-ignore|dcommit|show-ignore|mkdirs|proplist|pr=
opget|show-externals)
+          # TODO: -r and --revision is undocumented for dcommit, show-ign=
ore and mkdirs.
+          opts+=3D(
+            '(-r --revision)'{-r,--revision}'[specify SVN revision]: :__g=
it_svn_revisions'
+	  )
+	;|
+	(propset|propget)
+	  opts+=3D( '1:property:(svn:ignore svn:keywords svn:executable svn:eol-=
style svn:mime-type svn:externals svn:needs-lock)' )
+        ;|
 =

-          if [[ $line[1] !=3D tag ]]; then
-            opts+=3D(
-              '(-t --tag)'{-t,--tag}'[create a tag]')
-          fi
-          ;;
+	# ;| style fall-throughs end; here on each command covered once
+        (blame)
+          opts+=3D(
+            '--git-format[produce output in git-blame format, with SVN re=
vision numbers instead of git commit hashes]'
+	    '*:file:__git_cached_files'
+	  )
+	;;
+        (branch)
+	  opts+=3D( '(-t --tag)'{-t,--tag}'[create a tag]' )
+	;;
+        (clone)
+          opts+=3D(
+	    '--preserve-empty-dirs[create a placeholder file for each empty dire=
ctory]'
+	    '--placeholder-filename=3D[specify name of placeholder files created=
 by --preserve-empty-dirs]:filename [.gitignore]:_files'
+            ':url:_urls'
+            '::directory:_directories'
+	  )
+	;;
+        (commit-diff)
+          # TODO: -m and --message is undocumented.
+          # TODO: -F and --file is undocumented.
+          opts+=3D(
+            '(-m --message)'{-m-,--message=3D}':message'
+            '(-F --file)'{-F-,--file=3D}':file:_files'
+	    ':original tree:__git_tree_ishs'
+	    ':new tree result:__git_tree_ishs'
+	    ':target:_urls'
+	  )
+	;;
+        (dcommit)
+	  # TODO: --set-svn-props is undocumented
+          opts+=3D(
+            '--commit-url[commit to a different SVN url]:SVN URL:_url'
+	    '(-i --interactive)'{-i,--interactive}'[ask for confirmation that a =
patch should be sent to SVN]'
+	    '--mergeinfo[add specified merge information during the dcommit]:mer=
geinfo' \
+            "--no-rebase[don't rebase or reset after committing]"
+	    '--set-svn-props:arg'
+	  )
+	;;
+        (fetch)
+          opts+=3D(
+	    '(-p --parent)'{-p,--parent}'[fetch only from SVN parent of current =
HEAD]'
+	  )
+	;;
+        (info)
+          opts+=3D(
+	    '--url[output only value of URL field]'
+	    ':file:__git_cached_files'
+	  )
+	;;
+        (init)
+	  opts+=3D( ':SVN URL:_urls' ':target directory:_directories' )
+        ;;
+	(find-rev)
+	  opts+=3D(
+	    '(-A --after -B --before)'{-B,--before}'[with no exact match, find l=
ast commit for current branch]'
+	    '(-A --after -B --before)'{-A,--after}'[with no exact match, find cl=
osest match searching forwards]'
+	    ':revision: _alternative "svn-revisions\:svn revision number\:__git_=
svn_revision_numbers -p r" "git-revisions\:git revision\:__git_revisions"'
+	  )
+	;;
         (log)
           declare -a revision_options
           __git_setup_revision_options
@@ -4096,47 +4296,46 @@ _git-svn () {
             '--limit=3D[like --max-count, but not counting merged/exclude=
d commits]: :__git_guard_number limit'
             '--incremental[give output suitable for concatenation]'
             '--show-commit[output git commit SHA-1, as well]'
-            '--color[undocumented]'
-            '--pager[undocumented]:pager:_cmdstring'
-            '--non-recursive[undocumented]')
-          ;;
-        (blame)
+            '--color'
+            '--pager:pager:_cmdstring'
+            '--non-recursive'
+	    ':file:__git_cached_files'
+	  )
+	;;
+        (migrate)
+          opts+=3D( '--minimize' )
+        ;;
+	(propset)
+	  opts+=3D( ':value' )
+	;&
+	(proplist|propget)
+          opts+=3D( '*:file:__git_cached_files' )
+	;;
+        (rebase)
           opts+=3D(
-            '--git-format[produce output in git-blame format, with SVN re=
vision numbers instead of git commit hashes]')
-          ;;
-        (set-tree)
-          opts+=3D(
-            '--stdin[read list of commits to commit from stdin]')
-          ;;
-        (create-ignore|show-ignore|mkdirs|proplist|propget|show-externals=
)
-          # TODO: -r and --revision is undocumented for show-ignore and m=
kdirs.
-          opts+=3D(
-            '(-r --revision)'{-r,--revision}'[specify SVN revision]: :__g=
it_svn_revisions')
-          ;;
-        (commit-diff)
-          # TODO: -m and --message is undocumented.
-          # TODO: -F and --file is undocumented.
-          # TODO: -r and --revision is undocumented.
-          opts+=3D(
-            '(-m --message)'{-m-,--message=3D}'[undocumented]:message'
-            '(-F --file)'{-F-,--file=3D}'[undocumented]: :_files'
-            '(-r --revision)'{-r-,--revision=3D}'[undocumented]: :__git_s=
vn_revisions')
-          ;;
-        (info)
-          opts+=3D(
-            '--url[output only value of URL field]')
-          ;;
+	  '(-l --local)'{-l,--local}"[don't fetch remotely, rebase against the l=
ast fetched commit from SVN]"
+	    '(--preserve-merges -p)'{--preserve-merges,-p}'[try to recreate merg=
es instead of ignoring them]'
+	  )
+	;;
         (reset)
           opts+=3D(
             '(-r --revision)'{-r,--revision}'[specify most recent SVN rev=
ision to keep]: :__git_svn_revisions'
-            '(-p --parent)'{-p,--parent}'[discard specified revision as w=
ell, keeping nearest parent instead]')
-          ;;
+            '(-p --parent)'{-p,--parent}'[discard specified revision as w=
ell, keeping nearest parent instead]'
+	  )
+	;;
+        (set-tree)
+          opts+=3D( '--stdin[read list of commits to commit from stdin]' =
)
+	;;
+	(create-ignore|gc|mkdirs|show-externals|show-ignore|tag) ;;
+        (*) # fallback to files on any new/unrecognised commands
+          opts+=3D( '*:file:_files' )
+        ;;
       esac
 =

-      _arguments -w -C -S -s \
-        '(-h -H --help)'{-h,-H,--help}'[display usage information]' \
-        '(-V --version)'{-V,--version}'[display version information]' \
-        '--minimize-connections[undocumented]' \
+      _arguments -C -S -s \
+        '(-)'{-h,-H}'[display usage information]' \
+        '(-)'{-V,--version}'[display version information]' \
+        '--minimize-connections' \
         '(-R --svn-remote --remote)'{-R,--svn-remote,--remote}'[svn remot=
e to use]:svn remote:__git_svn-remotes' \
         '(-i --id)'{-i,--id}'[set GIT_SVN_ID]:GIT_SVN_ID' \
         $opts && ret=3D0
@@ -4163,7 +4362,7 @@ _git-apply () {
   local -a apply_options
   __git_setup_apply_options
 =

-  _arguments -w -S -s \
+  _arguments -S -s \
     $apply_options \
     '(--index --cached --reject)'{-3,--3way}'[fall back on 3-way merge if=
 patch fails]' \
     '--stat[output diffstat for input (turns off "apply")]' \
@@ -4178,6 +4377,7 @@ _git-apply () {
     '--unidiff-zero[disable unified-diff-context check]' \
     '--apply[apply patches that would otherwise not be applied]' \
     '--no-add[ignore additions made by the patch]' \
+    '--allow-overlap[allow overlapping hunks]' \
     '--inaccurate-eof[work around missing-new-line-at-EOF bugs]' \
     '(-v --verbose)'{-v,--verbose}'[display progress on stderr]' \
     '--recount[do not trust line counts in hunk headers]' \
@@ -4192,33 +4392,30 @@ _git-checkout-index () {
     z_opt=3D'-z[paths are separated with NUL character when reading from =
standard input]'
   fi
 =

-  _arguments -w -S -s \
+  _arguments -S -s \
     '(-u --index)'{-u,--index}'[update stat information in index]' \
-    '(-q --quiet)'{-q,--quiet}'[do not complain about existing files or m=
issing files]' \
+    '(-q --quiet)'{-q,--quiet}'[no warning for existing files and files n=
ot in index]' \
     '(-f --force)'{-f,--force}'[force overwrite of existing files]' \
     '(-a --all --stdin *)'{-a,--all}'[check out all files in index]' \
     '(-n --no-create)'{-n,--no-create}'[do not checkout new files]' \
-    '--prefix=3D-[prefix to use when creating files]:directory:_directori=
es' \
-    '--stage=3D-[check out files from named stage]:stage:(1 2 3 all)' \
     '--temp[write content to temporary files]' \
     '(-a --all *)--stdin[read list of paths from the standard input]' \
+    '--prefix=3D[prefix to use when creating files]:directory:_directorie=
s' \
+    '--stage=3D[check out files from named stage]:stage:(1 2 3 all)' \
     $z_opt \
     '*: :__git_cached_files'
 }
 =

 (( $+functions[_git-commit-tree] )) ||
 _git-commit-tree () {
-  if (( CURRENT =3D=3D 2 )); then
-    _arguments \
-      '-h[display usage]' \
-      ': :__git_trees'
-  elif [[ $words[CURRENT-1] =3D=3D -p ]]; then
-    local expl
-    _description commits expl 'parent commit'
-    __git_objects $expl
-  else
-    compadd - '-p'
-  fi
+  _arguments \
+    '-h[display usage]' \
+    '*-p+[specify parent commit]:parent commit:__git_objects' \
+    '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=3D-}'[GPG-sign the com=
mit]::key id' \
+    "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit=
]" \
+    '-F+[read commit log from specified file]:file:_files' \
+    '*-m+[specify paragraph of commit log message]:message' \
+    ': :__git_trees'
 }
 =

 (( $+functions[_git-hash-object] )) ||
@@ -4231,6 +4428,7 @@ _git-hash-object () {
     '-w[write object to object database]' \
     '(: --stdin-paths)--stdin[read object from standard input]' \
     '(: --stdin --path)--stdin-paths[read file names from standard input =
instead of from command line]' \
+    '--literally[just hash any random garbage to create corrupt objects f=
or debugging Git]' \
     '(       --no-filters)--path=3D[hash object as if it were located at =
given path]: :_files' \
     '(--path             )--no-filters[hash contents as is, ignoring any =
input filters]' \
     '(--stdin --stdin-paths):file:_files'
@@ -4254,6 +4452,7 @@ _git-index-pack () {
     '--stdin[read pack from stdin and instead write to specified file]' \
     $stdin_opts \
     '--strict[die if the pack contains broken objects or links]' \
+    '--threads=3D[specify number of threads to use]:threads' \
     ':pack file:_files -g "*.pack(-.)"'
 }
 =

@@ -4280,7 +4479,7 @@ _git-merge-file () {
     '(--ours          --union)--theirs[resolve conflicts favoring their s=
ide of the lines]' \
     '(--ours --theirs        )--union[resolve conflicts favoring both sid=
es of the lines]' \
     '--marker-size[specify length of conflict markers]: :__git_guard_numb=
er "marker length"' \
-    '--diff3[undocumented]' \
+    '--diff3[use a diff3 based merge]' \
     ':current file:_files' \
     ':base file:_files' \
     ':other file:_files'
@@ -4310,7 +4509,7 @@ _git-mktag () {
 =

 (( $+functions[_git-mktree] )) ||
 _git-mktree () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '-z[read NUL-terminated ls-tree -z output]' \
     '--missing[allow missing objects]' \
     '--batch[allow creation of more than one tree]'
@@ -4325,42 +4524,45 @@ _git-pack-objects () {
   fi
 =

   # NOTE: --index-version is only used by the Git test suite.
-  # TODO: --reflog is undocumented.
-  # TODO: --keep-unreachable is undocumented.
-  # TODO: --unpack-unreachable is undocumented.
   _arguments -A '-*' \
-    '(: --max-pack-size)--stdout[write pack contents to standard output]'=
 \
+    '(-q --quiet)'{-q,--quiet}"[don't report progress]" \
+    '(-q --quiet --all-progress)--progress[show progress meter]' \
+    '(-q --quiet --progress --all-progress-implied)--all-progress[show pr=
ogress meter during object writing phase]' \
+    '(-q --quiet --all-progress)--all-progress-implied[like --all-progres=
s, but only if --progress was also passed]' \
+    '(--stdout)--max-pack-size=3D[specify maximum size of each output pac=
k file]: : __git_guard_bytes "maximum pack size"' \
+    '(--incremental)--local[similar to --incremental, but only ignore unp=
acked non-local objects]' \
+    '(--local)--incremental[ignore objects that have already been packed]=
' \
+    '--window=3D-[limit pack window by objects]: :__git_guard_number "win=
dow size"' \
+    '--window-memory=3D-[specify window size in memory]: : __git_guard_by=
tes "window size"' \
+    '--depth=3D-[maximum delta depth]: :__git_guard_number "maximum delta=
 depth"' \
+    "--no-reuse-delta[don't reuse existing deltas, but compute them from =
scratch]" \
+    "--no-reuse-object[don't reuse existing object data]" \
+    '--delta-base-offset[use delta-base-offset packing]' \
+    '--threads=3D-[specify number of threads for searching for best delta=
 matches]: :__git_guard_number "number of threads"' \
+    '--non-empty[only create a package if it contains at least one object=
]' \
     '--revs[read revision arguments from standard input]' \
     '(--revs)--unpacked[limit objects to pack to those not already packed=
]' \
     '(--revs)--all[include all refs as well as revisions already specifie=
d]' \
+    '--reflog[include objects referred by reflog entries]' \
+    '--indexed-objects[include objects referred to by the index]' \
+    '(: --max-pack-size)--stdout[output pack to stdout]' \
     '--include-tag[include unasked-for annotated tags if object they refe=
rence is included]' \
-    '--window=3D-[number of objects to use per delta compression]: :__git=
_guard_number "window size"' \
-    '--depth=3D-[maximum delta depth]: :__git_guard_number "maximum delta=
 depth"' \
-    '--window-memory=3D-[window size in memory]:window size:__git_guard_b=
ytes' \
-    '(--stdout)--max-pack-size=3D[maximum size of each output packfile]:m=
aximum pack size:__git_guard_bytes' \
-    '--honor-pack-keep[ignore objects in local pack with .keep file]' \
-    '(              --local)--incremental[ignore objects that have alread=
y been packed]' \
-    '(--incremental        )--local[similar to --incremental, but only ig=
nore unpacked non-local objects]' \
-    '--non-empty[only create a package if it contains at least one object=
]' \
-    '(           --all-progress)--progress[display progress on standard e=
rror]' \
-    '(--progress                --all-progress-implied)--all-progress[dis=
play progress output on standard error, even during write-out phase]' \
-    '(--all-progress)--all-progress-implied[like --all-progress, but only=
 if --progress was also passed]' \
-    '-q[do not report progress]' \
-    '--no-reuse-delta[do not reuse existing deltas, but compute them from=
 scratch]' \
-    '--no-reuse-object[do not reuse existing object data]' \
-    '--compression=3D-[specify compression level]: :__git_compression_lev=
els' \
+    '(--unpack-unreachable)--keep-unreachable[keep unreachable ]' \
+    '(--keep-unreachable)--unpack-unreachable=3D-[unpack unreachable obje=
cts newer than specified time]::time' \
+    '--include-tag[include tag objects that refer to objects to be packed=
]' \
     $thin_opt \
-    '--delta-base-offset[use delta-base-offset packing]' \
-    '--threads=3D-[specify number of threads for searching for best delta=
 matches]: :__git_guard_number "number of threads"' \
+    '--shallow[create packs suitable for shallow fetches]' \
+    '--honor-pack-keep[ignore objects in local pack with .keep file]' \
+    '--compression=3D-[specify compression level]: :__git_compression_lev=
els' \
     '--keep-true-parents[pack parents hidden by grafts]' \
-    '(                   --unpack-unreachable)--keep-unreachable[undocume=
nted]' \
-    '(--keep-unreachable                     )--unpack-unreachable[undocu=
mented]' \
+    '--use-bitmap-index[use a bitmap index if available to speed up count=
ing objects]' \
+    '--write-bitmap-index[write a bitmap index together with the pack ind=
ex]' \
     ':base-name:_files'
 }
 =

 (( $+functions[_git-prune-packed] )) ||
 _git-prune-packed () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(-n --dry-run)'{-n,--dry-run}'[only list objects that would be remov=
ed]' \
     '(-q --quiet)'{-q,--quiet}'[do not display progress on standard error=
]'
 }
@@ -4389,7 +4591,7 @@ _git-read-tree () {
     exclude_per_directory_opt=3D'--exclude-per-directory=3D-[specify .git=
ignore file]:.gitignore file:_files'
   fi
 =

-  _arguments -w -S -s \
+  _arguments -S -s \
     '(   --reset --prefix)-m[perform a merge, not just a read]' \
     '(-m         --prefix)--reset[perform a merge, not just a read, ignor=
ing unmerged entries]' \
     '(-m --reset          2 3)--prefix=3D-[read the contents of specified=
 tree-ish under specified directory]:prefix:_directories -r ""' \
@@ -4409,7 +4611,7 @@ _git-read-tree () {
 =

 (( $+functions[_git-symbolic-ref] )) ||
 _git-symbolic-ref () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(-d --delete)'{-d,--delete}'[delete symbolic ref]' \
     '(-q --quiet)'{-q,--quiet}'[do not issue error if specified name is n=
ot a symbolic ref]' \
     '--short[shorten the ref name (eg. refs/heads/master -> master)]' \
@@ -4436,13 +4638,11 @@ _git-update-index () {
   fi
 =

   _arguments -S \
-    $refreshables \
     '(-)'{-h,--help}'[display usage information]' \
+    '-q[continue refresh even when index needs update]' \
     '--add[add files not already in index]' \
-    '(         --force-remove)--remove[remove files that are in the index=
 but are missing from the work tree]' \
-    '(--remove               )--force-remove[remove files from both work =
tree and index]' \
+    '(--force-remove)--remove[remove files that are in the index but are =
missing from the work tree]' \
     '(-q --unmerged --ignore-missing --really-refresh)--refresh[refresh i=
ndex]' \
-    '-q[run quietly]' \
     '--ignore-submodules[do not try to update submodules]' \
     '--unmerged[if unmerged changes exists, ignore them instead of exitin=
g]' \
     '--ignore-missing[ignore missing files when refreshing the index]' \
@@ -4457,10 +4657,16 @@ _git-update-index () {
     '(-)'{-g,--again}'[run git-update-index on differing index entries]' =
\
     '(-)--unresolve[restore "unmerged" or "needs updating" state of files=
]' \
     '--info-only[only insert files object-IDs into index]' \
-    '(--remove)--force-remove[remove file from index even when working di=
rectory has no such file]' \
     '--replace[replace files already in index, if necessary]' \
+    '(--remove)--force-remove[remove named paths even if present in workt=
ree]' \
     '(: -)--stdin[read list of paths from standard input]' \
     '--verbose[report what is being added and removed from the index]' \
+    '--clear-resolve-undo[forget saved unresolved conflicts]' \
+    '--index-version=3D[write index in specified on-disk format version]:=
version:(2 3 4)' \
+    '--split-index[enable/disable split index]' \
+    '--untracked-cache[enable/disable untracked cache]' \
+    '--test-untracked-cache[test if the filesystem supports untracked cac=
he]' \
+    '--force-untracked-cache[enable untracked cache without testing the f=
ilesystem]' \
     $z_opt \
     '*:: :_files'
 }
@@ -4473,12 +4679,13 @@ _git-update-ref () {
     z_opt=3D'-z[values are separated with NUL character when reading from=
 stdin]'
   fi
 =

-  _arguments -w -S -s \
+  _arguments -S -s \
     '-m[update reflog for specified name with specified reason]:reason fo=
r update' \
     '(:)-d[delete given reference after verifying its value]:symbolic ref=
erence:__git_revisions:old reference:__git_revisions' \
     '(-d --no-deref)--stdin[reads instructions from standard input]' \
     $z_opt \
     '(-d -z --stdin)--no-deref[overwrite ref itself, not what it points t=
o]' \
+    '--create-reflog[create a reflog]' \
     ':symbolic reference:__git_revisions' \
     ':new reference:__git_revisions' \
     '::old reference:__git_revisions'
@@ -4487,7 +4694,7 @@ _git-update-ref () {
 (( $+functions[_git-write-tree] )) ||
 _git-write-tree () {
   # NOTE: --ignore-cache-tree is only used for debugging.
-  _arguments -w -S -s \
+  _arguments -S -s \
     '--missing-ok[ignore objects in index that are missing in object data=
base]' \
     '--prefix=3D[write tree representing given sub-directory]:sub-directo=
ry:_directories -r ""'
 }
@@ -4496,14 +4703,17 @@ _git-write-tree () {
 =

 (( $+functions[_git-cat-file] )) ||
 _git-cat-file () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(- 1)-t[show type of given object]' \
     '(- 1)-s[show size of given object]' \
     '(- 1)-e[exit with zero status if object exists]' \
     '(- 1)-p[pretty-print given object]' \
     '(- 1)--textconv[show content as transformed by a textconv filter]' \
-    '(- :)--batch=3D-[print SHA1, type, size and contents (or in <format>=
) of objects given on stdin]:format' \
-    '(- :)--batch-check=3D-[print SHA1, type and size (or in <format>) of=
 objects given on stdin]:format' \
+    '--allow-unknown-type[allow -s and -t to work with broken/corrupt obj=
ects]' \
+    '(- :)--batch=3D-[print SHA1, type, size and contents (or in specifie=
d format)]::format' \
+    '(- :)--batch-check=3D-[print SHA1, type and size (or in specified fo=
rmat)]::format' \
+    '--follow-symlinks[follow in-tree symlinks (used with --batch or --ba=
tch-check)]' \
+    '--batch-all-objects[show all objects with --batch or --batch-check]'=
 \
     '(-):object type:(blob commit tag tree)' \
     ': :__git_objects'
 }
@@ -4514,7 +4724,7 @@ _git-diff-files () {
   __git_setup_revision_options
   __git_setup_diff_stage_options
 =

-  _arguments -w -S -s \
+  _arguments -S -s \
     $revision_options \
     $diff_stage_options \
     ': :__git_changed-in-working-tree_files' \
@@ -4533,7 +4743,7 @@ _git-diff-index () {
   # to given tree-ish?  This should be done for git-diff as well, in that=
 case.
   _arguments -S \
     $revision_options \
-    '--cached[do not consider the work tree at all]' \
+    "--cached[don't consider the work tree at all]" \
     '-m[flag non-checked-out files as up-to-date]' \
     ': :__git_tree_ishs' \
     '*: :__git_cached_files'
@@ -4550,7 +4760,7 @@ _git-diff-tree () {
   # NOTE: -r, -t, --root are actually parsed for all
   # __git_setup_revision_options, but only used by this command, so only =
have
   # them here.
-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     $revision_options \
     '-r[recurse into subdirectories]' \
     '(-r   )-t[disply tree objects in diff output]' \
@@ -4595,10 +4805,14 @@ _git-for-each-ref () {
   # TODO: Better completion for --format: should complete %(field) stuff,=
 that
   # is, %(refname), %(objecttype), %(objectsize), %(objectname) with opti=
onal '*'
   # in front.
-  _arguments -w -S -s \
+  _arguments -S -s \
     '--count=3D[maximum number of refs to iterate over]: :__git_guard_num=
ber "maximum number of refs"' \
-    '--sort=3D[key to sort refs by]: :__git_ref_sort_keys' \
+    '*--sort=3D[key to sort refs by]: :__git_ref_sort_keys' \
     '--format=3D-[output format of ref information]:format' \
+    '*--points-at=3D[print only refs which point at the given object]:obj=
ect:__git_commits' \
+    '*--merged=3D[print only refs that are merged]:object:__git_commits' =
\
+    '*--no-merged=3D[print only refs that are not merged]:object:__git_co=
mmits' \
+    '*--contains=3D[print only refs which contain the commit]:object:__gi=
t_commits' \
     '(-s --shell -p --perl --python --tcl)'{-s,--shell}'[use string liter=
als suitable for sh]' \
     '(-s --shell -p --perl --python --tcl)'{-p,--perl}'[use string litera=
ls suitable for Perl]' \
     '(-s --shell -p --perl          --tcl)'--python'[use string literals =
suitable for Python]' \
@@ -4611,13 +4825,13 @@ _git-ls-files () {
   local no_empty_directory_opt=3D
 =

   if (( words[(I)--directory] )); then
-    no_empty_directory_opt=3D'--no-empty-directory[do not list empty dire=
ctories]'
+    no_empty_directory_opt=3D"--no-empty-directory[don't list empty direc=
tories]"
   fi
 =

   # TODO: --resolve-undo is undocumented.
   # TODO: Replace _files with something more intelligent based on seen op=
tions.
   # TODO: Apply excludes like we do for git-clean.
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(-c --cached)'{-c,--cached}'[show cached files in output]' \
     '(-d --deleted)'{-d,--deleted}'[show deleted files in output]' \
     '(-m --modified)'{-m,--modified}'[show modified files in output]' \
@@ -4625,6 +4839,7 @@ _git-ls-files () {
     '(-i --ignored)'{-i,--ignored}'[show ignored files in output]' \
     '(-s --stage --with-tree)'{-s,--stage}'[show stage files in output]' =
\
     '--directory[if a whole directory is classified as "other", show just=
 its name]' \
+    '--eol[show line endings of files]' \
     $no_empty_directory_opt \
     '(-s --stage -u --unmerged --with-tree)'{-u,--unmerged}'[show unmerge=
d files in output]' \
     '(-k --killed)'{-k,--killed}'[show killed files in output]' \
@@ -4638,6 +4853,7 @@ _git-ls-files () {
     '-v[identify each files status (hmrck?)]' \
     '--full-name[force paths to be output relative to the project top dir=
ectory]' \
     '--abbrev=3D[set minimum SHA1 display-length]: :__git_guard_number le=
ngth' \
+    '--debug[show debugging data]' \
     '*:: :_files'
 }
 =

@@ -4645,11 +4861,14 @@ _git-ls-files () {
 _git-ls-remote () {
   # TODO: repository needs fixing
   _arguments -A '-*' \
+    '(-q --quiet)'{-q,--quiet}"[don't print remote URL]" \
+    '--upload-pack=3D[specify path to git-upload-pack on remote side]:rem=
ote path' \
     '(-h --heads)'{-h,--heads}'[show only refs under refs/heads]' \
     '(-t --tags)'{-t,--tags}'[show only refs under refs/tags]' \
-    '(-u --upload-pack)'{-u,--upload-pack=3D-}'[specify path to git-uploa=
d-pack on remote side]:remote path' \
+    "--refs[don't show peeled tags]" \
     '--exit-code[exit with status 2 when no matching refs are found in th=
e remote repository]' \
     '--get-url[expand the URL of the given repository taking into account=
 any "url.<base>.insteadOf" config setting]' \
+    '--symref[show underlying ref in addition to the object pointed by it=
]' \
     ': :__git_any_repositories' \
     '*: :__git_references'
 }
@@ -4659,7 +4878,7 @@ _git-ls-tree () {
   local curcontext=3D$curcontext state line ret=3D1
   declare -A opt_args
 =

-  _arguments -w -C -S -s \
+  _arguments -C -S -s \
     '(-t)-d[do not show children of given tree (implies -t)]' \
     '-r[recurse into subdirectories]' \
     '-t[show tree entries even when going to recurse them]' \
@@ -4683,7 +4902,7 @@ _git-ls-tree () {
 =

 (( $+functions[_git-merge-base] )) ||
 _git-merge-base () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(-a --all)'{-a,--all}'[display all common ancestors]' \
     '--octopus[compute best common ancestors of all supplied commits]' \
     '--is-ancestor[tell if A is ancestor of B (by exit status)]' \
@@ -4757,7 +4976,7 @@ _git-show-index () {
 _git-show-ref () {
   _arguments -S \
     - list \
-      '(-h --head)'{-h,--head}'[show the HEAD reference, even if it would=
 normally be filtered out]' \
+      '--head[show the HEAD reference, even if it would normally be filte=
red out]' \
       '--tags[show only refs/tags]' \
       '--heads[show only refs/heads]' \
       '(-d --dereference)'{-d,--dereference}'[dereference tags into objec=
t IDs as well]' \
@@ -4789,7 +5008,7 @@ _git-var () {
 =

 (( $+functions[_git-verify-pack] )) ||
 _git-verify-pack () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(-v --verbose)'{-v,--verbose}'[show objects contained in pack]' \
     '(-s --stat-only)'{-s,--stat-only}'[do not verify pack contents; only=
 display histogram of delta chain length]' \
     '*:index file:_files -g "*.idx"'
@@ -4837,6 +5056,7 @@ _git-fetch-pack () {
   # TODO: Limit * to __git_head_references?
   _arguments -A '-*' \
     '--all[fetch all remote refs]' \
+    '--stdin[take the list of refs from stdin]' \
     '(-q --quiet)'{-q,--quiet}'[make output less verbose]' \
     '(-k --keep)'{-k,--keep}'[do not invoke git-unpack-objects on receive=
d data]' \
     '--thin[fetch a thin pack]' \
@@ -4844,6 +5064,7 @@ _git-fetch-pack () {
     '(--upload-pack --exec)'{--upload-pack=3D-,--exec=3D-}'[specify path =
to git-upload-pack on remote side]:remote path' \
     '--depth=3D-[limit fetching to ancestor-chains not longer than given =
number]: :__git_guard_number "maximum ancestor-chain length"' \
     '--no-progress[do not display progress]' \
+    '--diag-url' \
     '-v[produce verbose output]' \
     ': :__git_any_repositories' \
     '*: :__git_references'
@@ -4856,6 +5077,12 @@ _git-http-backend () {
 =

 (( $+functions[_git-send-pack] )) ||
 _git-send-pack () {
+  local -a sign
+  sign=3D(
+    {yes,true}'\:always,\ and\ fail\ if\ unsupported\ by\ server'
+    {no,false}'\:never'
+    if-asked'\:iff\ supported\ by\ server'
+  )
   _arguments -A '-*' \
     '(-v --verbose)'{-v,--verbose}'[produce verbose output]' \
     '(-q --quiet)'{-q,--quiet}'[be more quiet]' \
@@ -4865,12 +5092,14 @@ _git-send-pack () {
     '(-n --dry-run)'{-n,--dry-run}'[do everything except actually sending=
 the updates]' \
     '--mirror[mirror all refs]' \
     '(-f --force)'{-f,--force}'[update remote orphaned refs]' \
-    '(--no-signed --signed)--sign=3D[GPG sign the push]:signing enabled:(=
yes no if-asked)' \
+    "(--no-signed --signed)--sign=3D-[GPG sign the push]::signing enabled=
:(($^^sign))" \
     '(--no-signed --sign)--signed[GPG sign the push]' \
-    "(--sign --sign)--no-signed[don't GPG sign the push]" \
+    "(--sign --signed)--no-signed[don't GPG sign the push]" \
+    '--progress[force progress reporting]' \
     '--thin[send a thin pack]' \
     '--atomic[request atomic transaction on remote side]' \
     '--stateless-rpc[use stateless RPC protocol]' \
+    '--stdin[read refs from stdin]' \
     '--helper-status[print status from remote helper]' \
     '--force-with-lease=3D[require old value of ref to be at specified va=
lue]:refname\:expect' \
     ': :__git_any_repositories' \
@@ -4879,7 +5108,7 @@ _git-send-pack () {
 =

 (( $+functions[_git-update-server-info] )) ||
 _git-update-server-info () {
-  _arguments -w -S -s \
+  _arguments -S -s \
     '(-f --force)'{-f,--force}'[update the info files from scratch]'
 }
 =

@@ -4917,6 +5146,7 @@ _git-receive-pack () {
   # TODO: --advertise-refs is undocumented.
   # TODO: --stateless-rpc is undocumented.
   _arguments -A '-*' \
+    '(-q --quiet)'{-q,--quiet}'[be quiet]' \
     '--advertise-refs[undocumented]' \
     '--stateless-rpc[undocumented]' \
     ':directory to sync into:_directories'
@@ -4978,10 +5208,9 @@ _git-upload-pack () {
   # TODO: --advertise-refs is undocumented.
   # TODO: --stateless-rpc is undocumented.
   _arguments -S -A '-*' \
-    '--strict[do not try <directory>/.git/ if <directory> is not a git di=
rectory' \
+    "--strict[don't try <directory>/.git/ if <directory> is not a git dir=
ectory]" \
     '--timeout=3D-[interrupt transfer after given number of seconds of in=
activity]: :__git_guard_number "inactivity timeout"' \
-    '--advertise-refs[undocumented]' \
-    '--stateless-rpc[undocumented]' \
+    --advertise-refs --stateless-rpc \
     ': :_directories'
 }
 =

@@ -5041,15 +5270,15 @@ _git-check-ref-format () {
     '(--no-allow-onelevel)--allow-onelevel[accept one-level refnames]' \
     '(--allow-onelevel)--no-allow-onelevel[do not accept one-level refnam=
es]' \
     '--refspec-pattern[interpret <refname> as a reference name pattern fo=
r a refspec]' \
-    '--normalize[Normalize refname by removing leading slashes]' \
+    '--normalize[normalize refname by removing leading slashes]' \
     '--branch[expand previous branch syntax]' \
     ': :__git_references'
 }
 =

 (( $+functions[_git-fmt-merge-msg] )) ||
 _git-fmt-merge-msg () {
-  _arguments -w -S -s \
-    '(      --no-log)--log[display one-line descriptions from actual comm=
its being merged]' \
+  _arguments -S -s \
+    '(      --no-log)--log=3D-[display one-line descriptions from actual =
commits being merged]::number of commits [20]' \
     '(--log         )--no-log[do not display one-line descriptions from a=
ctual commits being merged]' \
     '(-m --message)'{-m+,--message=3D}'[use given message instead of bran=
ch names for first line in log message]:message' \
     '(-F --file)'{-F,--file}'[specify list of merged objects from file]: =
:_files'
@@ -5059,10 +5288,12 @@ _git-fmt-merge-msg () {
 _git-mailinfo () {
   # TODO: --no-inbody-headers is undocumented.
   _arguments -A '-*' \
-    '-k[do not strip/add \[PATCH\] from first line of commit message]' \
+    '(-b)-k[prevent removal of cruft from Subject: header]' \
+    '(-k)-b[limit stripping of bracketed strings to the word PATCH]' \
     '(-u --encoding)-u[encode commit information in UTF-8]' \
     '(-u --encoding)--encoding=3D-[encode commit information in given enc=
oding]: :__git_encodings' \
     '-n[disable all charset re-coding of metadata]' \
+    '(-m --message-id)'{-m,--message-id}'[copy the Message-ID header at t=
he end of the commit message]' \
     '(           --no-scissors)--scissors[remove everything in body befor=
e a scissors line]' \
     '(--scissors              )--no-scissors[do not remove everything in =
body before a scissors line]' \
     '--no-inbody-headers[undocumented]' \
@@ -5088,7 +5319,9 @@ _git-merge-one-file () {
 =

 (( $+functions[_git-patch-id] )) ||
 _git-patch-id () {
-  _message 'no arguments allowed; accepts patch on standard input'
+   _arguments \
+     '--stable[use a sum of hashes unaffected by diff ordering]' \
+     '--unstable[use patch-id compatible with git 1.9 and older]'
 }
 =

 # NOTE: git-sh-setup isn't a user command.
@@ -5282,8 +5515,10 @@ _git_commands () {
     stash:'stash away changes to dirty working directory'
     status:'show working-tree status'
     submodule:'initialize, update, or inspect submodules'
-    tag:'create, list, delete or verify tag object signed with GPG')
-
+    subtree:'split repository into subtrees and merge them'
+    tag:'create, list, delete or verify tag object signed with GPG'
+    worktree:'manage multiple working dirs attached to the same repositor=
y'
+  )
   ancillary_manipulator_commands=3D(
     config:'get and set repository or global options'
     fast-export:'data exporter'
@@ -6117,8 +6352,7 @@ __git_submodules () {
   local expl
   declare -a submodules
 =

-  submodules=3D(${${${(f)"$(_call_program submodules git submodule 2>/dev=
/null)"}#?* }%% *})
-  __git_command_successful $pipestatus || return 1
+  submodules=3D( ${${${(f)"$(_call_program submodules git submodule)"}#?*=
 }%% *} )
 =

   _wanted submodules expl submodule compadd "$@" -a - submodules
 }
@@ -6495,7 +6729,7 @@ __git_guard_number () {
 =

 (( $+functions[__git_guard_bytes] )) ||
 __git_guard_bytes () {
-  _guard '[[:digit:]]#([kKmMgG]|)' $*
+  _guard '[[:digit:]]#([kKmMgG]|)' ${*:-size}
 }
 =

 (( $+functions[__git_datetimes] )) ||
@@ -6525,7 +6759,9 @@ __git_setup_log_options () {
     '(--decorate              )--no-decorate[do not print out ref names o=
f any commits that are shown]'
     '(          --no-follow)--follow[follow renames]'
     '(--follow             )--no-follow[do not follow renames]'
-    '--source[show which ref each commit is reached from]')
+    '--source[show which ref each commit is reached from]'
+    '-L+[trace the evolution of a line range or regex within a file]:rang=
e'
+  )
 }
 =

 (( $+functions[__git_setup_diff_options] )) ||
@@ -6572,7 +6808,7 @@ __git_setup_diff_options () {
     '(--full-index)--binary[in addition to --full-index, output binary di=
ffs for git-apply]'
     '--abbrev=3D[set minimum SHA1 display-length]: :__git_guard_number le=
ngth'
     '(-B --break-rewrites)'{-B-,--break-rewrites=3D-}'[break complete rew=
rite changes into pairs of given size]:: :__git_guard_number size'
-    '(-M --find-renames)'{-M-,--find-renames=3D-}'[Detect renames with gi=
ven scope]:: :__git_guard_number size'
+    '(-M --find-renames)'{-M-,--find-renames=3D-}'[detect renames with gi=
ven scope]:: :__git_guard_number size'
     '(-C --find-copies)'{-C-,--find-copies=3D-}'[detect copies as well as=
 renames with given scope]:: :__git_guard_number size'
     '--find-copies-harder[try harder to find copies]'
     '(-D --irreversible-delete)'{-D,--irreversible-delete}'[omit the prei=
mage for deletes]'
@@ -6592,7 +6828,6 @@ __git_setup_diff_options () {
     '--ignore-blank-lines[do not show hunks that add or remove blank line=
s]'
     '--inter-hunk-context=3D[combine hunks closer than n lines]:n'
     '--exit-code[report exit code 1 if differences, 0 otherwise]'
-    '(--exit-code)--quiet[disable all output]'
     '(           --no-ext-diff)--ext-diff[allow external diff helper to b=
e executed]'
     '(--ext-diff              )--no-ext-diff[disallow external diff helpe=
r to be executed]'
     '(--textconv --no-textconv)--textconv[allow external text conversion =
filters to be run when comparing binary files]'
@@ -6717,7 +6952,6 @@ __git_setup_revision_options () {
     '(-v --header)'{--pretty=3D-,--format=3D-}'[pretty print commit messa=
ges]::format:__git_format_placeholders'
     '(--abbrev-commit --no-abbrev-commit)--abbrev-commit[show only partia=
l prefixes of commit object names]'
     '(--abbrev-commit --no-abbrev-commit)--no-abbrev-commit[show the full=
 40-byte hexadecimal commit object name]'
-    '(--abbrev --no-abbrev)--abbrev=3D[set minimum SHA1 display-length (f=
or use with --abbrev-commit)]: :__git_guard_number length'
     '(--abbrev --no-abbrev)--no-abbrev[show the full 40-byte hexadecimal =
commit object name]'
     '--oneline[shorthand for --pretty=3Doneline --abbrev-commit]'
     '--encoding=3D-[output log messages in given encoding]:: :__git_encod=
ings'
@@ -6806,39 +7040,45 @@ __git_setup_merge_options () {
   merge_options=3D(
     '(         --no-commit)--commit[perform the merge and commit the resu=
lt]'
     '(--commit            )--no-commit[perform the merge but do not commi=
t the result]'
-    '(         --no-edit)--edit[open an editor to change the commit messa=
ge]'
-    '(--edit            )--no-edit[do not open an editor to change the co=
mmit message]'
+    '(         --no-edit -e)--edit[open an editor to change the commit me=
ssage]'
+    "(--edit             -e)--no-edit[don't open an editor to change the =
commit message]"
     '(     --no-ff)--ff[do not generate a merge commit if the merge resol=
ved as a fast-forward]'
     '(--ff        )--no-ff[generate a merge commit even if the merge reso=
lved as a fast-forward]'
-    '(      --no-log)--log[fill in one-line descriptions of the commits b=
eing merged in the log message]'
+    '(      --no-log)--log=3D-[add entries from shortlog to merge commit =
message]::entries to add'
     '(--log         )--no-log[do not list one-line descriptions of the co=
mmits being merged in the log message]'
     '(-n --no-stat)--stat[show a diffstat at the end of the merge]'
     '(--stat -n --no-stat)'{-n,--no-stat}'[do not show diffstat at the en=
d of the merge]'
     '(         --no-squash)--squash[merge, but do not commit]'
     '(--squash            )--no-squash[merge and commit]'
     '--ff-only[refuse to merge unless HEAD is up to date or merge can be =
resolved as a fast-forward]'
-    '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=3D}'[GPG-sign the comm=
it]::key id'
-    '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commi=
t]'
+    '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=3D-}'[GPG-sign the com=
mit]::key id'
+    "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit=
]"
     '*'{-s,--strategy=3D}'[use given merge strategy]:merge strategy:__git=
_merge_strategies'
     '*'{-X,--strategy-option=3D}'[pass merge-strategy-specific option to =
merge strategy]:option'
     '(--verify-signatures)--verify-signatures[verify the commits being me=
rged or abort]'
     '(--no-verify-signatures)--no-verify-signatures[do not verify the com=
mits being merged]'
     '(-q --quiet -v --verbose)'{-q,--quiet}'[suppress all output]'
-    '(-q --quiet -v --verbose)'{-v,--verbose}'[output additional informat=
ion]')
+    '(-q --quiet -v --verbose)'{-v,--verbose}'[output additional informat=
ion]'
+    '--allow-unrelated-histories[allow merging unrelated histories]'
+  )
 }
 =

 (( $+functions[__git_setup_fetch_options] )) ||
 __git_setup_fetch_options () {
   fetch_options=3D(
-    '(: *)--all[fetch all remotes]'
+    '(: * -m --multiple)--all[fetch all remotes]'
     '(-a --append)'{-a,--append}'[append ref names and object names of fe=
tched refs to "$GIT_DIR/FETCH_HEAD"]'
+    '(-j --jobs)'{-j+,--jobs=3D}'[specify number of submodules fetched in=
 parallel]:jobs'
     '--depth=3D[deepen the history of a shallow repository by the given n=
umber of commits]: :__git_guard_number depth'
     '--unshallow[convert a shallow clone to a complete one]'
+    '--update-shallow[accept refs that update .git/shallow]'
+    '--refmap=3D[specify refspec to map refs to remote tracking branches]=
:refspec'
+    '(-4 --ipv4 -6 --ipv6)'{-4,--ipv4}'[use IPv4 addresses only]'
+    '(-4 --ipv4 -6 --ipv6)'{-6,--ipv6}'[use IPv6 addresses only]'
     '--dry-run[show what would be done, without making any changes]'
     '(-f --force)'{-f,--force}'[allow refs that are not ancestors to be u=
pdated]'
     '(-k --keep)'{-k,--keep}'[keep downloaded pack]'
     '(-p --prune)'{-p,--prune}'[remove any remote tracking branches that =
no longer exist remotely]'
-    '(-n --no-tags -t --tags)'{-n,--no-tags}'[disable automatic tag follo=
wing]'
     '(--no-tags -t --tags)'{-t,--tags}'[fetch remote tags]'
     '(-u --update-head-ok)'{-u,--update-head-ok}'[allow updates of curren=
t branch head]'
     '--upload-pack=3D[specify path to git-upload-pack on remote side]:rem=
ote path'
@@ -6851,7 +7091,7 @@ __git_setup_fetch_options () {
     '--submodule-prefix=3D-[prepend <path> to paths printed in informativ=
e messages]:submodule prefix path:_files -/'
     '(-q --quiet -v --verbose --progress)'{-q,--quiet}'[suppress all outp=
ut]'
     '(-q --quiet -v --verbose)'{-v,--verbose}'[output additional informat=
ion]'
-    '(-q --quiet)--progress[output progress information]')
+    '(-q --quiet)--progress[force progress reporting]')
 }
 =

 (( $+functions[__git_setup_apply_options] )) ||
@@ -7160,7 +7400,7 @@ _git() {
   if (( CURRENT > 2 )); then
     local -a aliases
     local -A git_aliases
-    local k v
+    local a k v
     aliases=3D(${(0)"$(_call_program aliases git config -z --get-regexp '=
\^alias\.')"})
     for a in ${aliases}; do
         k=3D"${${a/$'\n'*}/alias.}"

