From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14925 invoked from network); 28 Jun 2007 15:21:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 28 Jun 2007 15:21:26 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 92145 invoked from network); 28 Jun 2007 15:21:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Jun 2007 15:21:21 -0000 Received: (qmail 6894 invoked by alias); 28 Jun 2007 15:21:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23610 Received: (qmail 6885 invoked from network); 28 Jun 2007 15:21:18 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 28 Jun 2007 15:21:18 -0000 Received: (qmail 91859 invoked from network); 28 Jun 2007 15:21:18 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 28 Jun 2007 15:21:15 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 84E105C3C6; Thu, 28 Jun 2007 11:21:14 -0400 (EDT) Date: Thu, 28 Jun 2007 11:21:14 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: _git describe + fixups for diff-index, diff-files, diff-stages, diff-tree Message-ID: <20070628152114.GA29090@scowler.net> Mail-Followup-To: zsh-workers@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Mutt/1.5.13 (2006-08-11) More merging from http://git.bitwi.se/?p=3Ddot-home.git Index: Completion/Unix/Command/_git =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v retrieving revision 1.8 diff -u -r1.8 _git --- Completion/Unix/Command/_git 28 Jun 2007 15:02:14 -0000 1.8 +++ Completion/Unix/Command/_git 28 Jun 2007 15:19:38 -0000 @@ -1,4 +1,4 @@ -#compdef git git-annotate git-apply git-checkout-index git-clean git-commi= t-tree git-hash-object git-index-pack git-init-db git-merge-index git-mktag= git-pack-objects git-prune-packed git-read-tree git-unpack-objects git-upd= ate-index git-write-tree git-cat-file git-diff-index git-diff-files git-dif= f-stages git-diff-tree git-fsck-objects git-ls-files git-ls-tree git-merge-= base git-name-rev git-rev-list git-show-index git-tar-tree git-unpack-file = git-var git-verify-pack git-clone-pack git-fetch-pack git-http-fetch git-lo= cal-fetch git-peek-remote git-receive-pack git-send-pack git-ssh-fetch git-= ssh-upload git-update-server-info git-upload-pack git-add git-am git-applym= box git-bisect git-branch git-checkout git-cherry-pick git-clone git-commit= git-diff git-fetch git-format-patch git-grep git-log git-ls-remote git-mer= ge git-mv git-octopus git-pull git-push git-rebase git-repack git-reset git= -resolve git-revert git-shortlog git-show-branch git-status git-verify-tag = git-whatchanged git-applypatch git-archimport git-archive git-convert-objec= ts git-cvsimport git-lost-found git-merge-one-file git-prune git-relink git= -svnimport git-symbolic-ref git-tag git-update-ref git-check-ref-format git= -cherry git-count-objects git-daemon git-get-tar-commit-id git-mailinfo git= -mailsplit git-patch-id git-request-pull git-send-email git-stripspace +#compdef git git-annotate git-apply git-checkout-index git-clean git-commi= t-tree git-describe git-hash-object git-index-pack git-init-db git-merge-in= dex git-mktag git-pack-objects git-prune-packed git-read-tree git-unpack-ob= jects git-update-index git-write-tree git-cat-file git-diff-index git-diff-= files git-diff-stages git-diff-tree git-fsck-objects git-ls-files git-ls-tr= ee git-merge-base git-name-rev git-rev-list git-show-index git-tar-tree git= -unpack-file git-var git-verify-pack git-clone-pack git-fetch-pack git-http= -fetch git-local-fetch git-peek-remote git-receive-pack git-send-pack git-s= sh-fetch git-ssh-upload git-update-server-info git-upload-pack git-add git-= am git-applymbox git-bisect git-branch git-checkout git-cherry-pick git-clo= ne git-commit git-diff git-fetch git-format-patch git-grep git-log git-ls-r= emote git-merge git-mv git-octopus git-pull git-push git-rebase git-repack = git-reset git-resolve git-revert git-shortlog git-show-branch git-status gi= t-verify-tag git-whatchanged git-applypatch git-archimport git-archive git-= convert-objects git-cvsimport git-lost-found git-merge-one-file git-prune g= it-relink git-svnimport git-symbolic-ref git-tag git-update-ref git-check-r= ef-format git-cherry git-count-objects git-daemon git-get-tar-commit-id git= -mailinfo git-mailsplit git-patch-id git-request-pull git-send-email git-st= ripspace =20 # Commands not completed: # git-sh-setup @@ -396,20 +396,36 @@ fi } =20 +_git-describe () { + _arguments \ + $abbrev_arg \ + '--all[use any ref found in "$GIT_DIR/refs/"]' \ + '--tags[use any tag found in "$GIT_DIR/refs/tags/"]' \ + $abbrev_arg \ + '--candidates=3D-[consider up to given number of canditates]: :_guard = "[[\:digit\:]]##" "number of canditates"' \ + '--debug[display information about the searching strategy]' \ + '*:committish:__git_committishs' && ret=3D0 +} + _git-diff-index () { _arguments -S \ $diff_args \ '--cached[do not consider the work tree at all]' \ '-m[flag non-checked-out files as up-to-date]' \ ':tree-ish:__git_tree_ishs' \ - '*:index file:__git_files' && ret=3D0 + '*::index file:__git_cached_files' && ret=3D0 } =20 _git-diff-files () { _arguments \ $diff_args \ - '-q[do not complain about nonexisting files]' \ - '*:file:_files' && ret=3D0 + '(-0 -1 -2 -3 --base --ours --theirs -c --cc)-0[omit diff output for u= nmerged entries]' \ + '(-0 -1 -2 -3 --base --ours --theirs -c --cc)'{-1,--base}'[diff agains= t "base" version]' \ + '(-0 -1 -2 -3 --base --ours --theirs -c --cc)'{-2,--ours}'[diff agains= t "our branch" version]' \ + '(-0 -1 -2 -3 --base --ours --theirs -c --cc)'{-3,--theirs}'[diff agai= nst "their branch" version]' \ + '(-0 -1 -2 -3 --base --ours --theirs -c --cc)'{-c,--cc}'[compare "our = branch", "their branch" and working tree files]' \ + '-q[remain silent even on nonexisting files]' \ + '*::file:_files' && ret=3D0 } =20 _git-diff-stages () { @@ -417,23 +433,27 @@ $diff_args \ ':stage 1:__git_stages' \ ':stage 2:__git_stages' \ - '*:index file:__git_files' && ret=3D0 + '*::index file:_files' && ret=3D0 } =20 _git-diff-tree () { local curcontext=3D$curcontext state line typeset -A opt_args =20 - _arguments -S \ + _arguments -C -S \ $diff_args \ $pretty_arg \ '--no-commit-id[skip output of commit IDs]' \ '--root[show diff against the empty tree]' \ '--stdin[read commit and tree information from standard input]' \ '-m[show merge commits]' \ - '-r[recurse into subdirectories]' \ - '(-r)-t[show tree entry itself as well as subtrees (implies -r)]' \ - '-v[show verbose headers]' \ + '(-t)-r[recurse into subdirectories]' \ + '-t[show tree entry itself as well as subtrees (implies -r)]' \ + '-s[do not show differences]' \ + '-v[show commit message before the differences]' \ + '(-c --cc)-c[show differences from each of the parents to the merge re= sult]' \ + '(-c --cc)--cc[how differences from each of the parents and omit diffe= rences from only one parent]' \ + '--always[always show commit itself and the commit log message]' \ ':tree-ish:__git_tree_ishs' \ '*::file:->files' && ret=3D0 =20 @@ -1380,6 +1400,10 @@ 'tags::__git_tags' } =20 +__git_committishs () { + __git_commits +} + # TODO: deal with prefixes and suffixes listed in git-rev-parse __git_revisions () { __git_commits $*