From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6526 invoked by alias); 5 Aug 2017 22:17:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41493 Received: (qmail 11096 invoked by uid 1010); 5 Aug 2017 22:17:45 -0000 X-Qmail-Scanner-Diagnostics: from nm39-vm6.bullet.mail.ir2.yahoo.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(212.82.97.165):SA:0(-2.8/5.0):. Processed in 5.291032 secs); 05 Aug 2017 22:17:45 -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=-2.8 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1501971068; bh=tv+JdN924/iNecOXukqNA93UNhrKM1ZvYpCQCMIGOm4=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=Suj25CG2avjhwmRwoqIXIt4ZVxwPsGQmtmTkV+7kZBj/I6/mB3Q+kgJzdDwOUja0wmAEsC+bG/u8Ck47N10biTFFwPds7B1JICXUuTL2uuvZwTNvTYapWIlU2o2KKZFWz0hXjPPSSl2+qkNQOI9IAw3cmxgBKqaCYdijTQahCp71PwflYC2iYcVJW6VDujTr2o9/UGsDn9aupu5YnAEjDUDT8B5qT7v2uzOSO7u/SIeIAj+VXrq32OhrIVXB53cfzzXkYDLAO0KtNjU8pJoDAIGGYf/EQhcQJHA415gkvjiMrCI0DUqi1QB6LczKgxjJxJTc7XfaxINBtb/AE+0MhQ== X-Yahoo-Newman-Id: 341174.49618.bm@smtp139.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: WgRbP.oVM1lm459QpMCIJrD3OoV.t9cGe6D76VfU_mHN5i6 GFdcv6a84VVanghT4P7u38zNGrVjRTPe4ca7MOoC9tD0WbegbJHxSZjlOMF9 AS4UQ52Hw49XJ7_QBxFIy9snTPec7GteiEJZuL3ZtX3j1phHt7N0e3tdGu37 PwHEcpRwgkQmHGktcrPM6nBEgCMObqHcRlwUebC9CuqUKeh3ef3Q7VU2YCYw Bhlb5aK3tt1ivMrCQ5niSfFM8DbNQjH58fgtd66YyqLSn.1zJ4oLBT1eAT7y 9QhVC2hR850aDsCS7GZi5hnEqyNOttuApuB4cIvI4LjryaI5HJdQQLPo.Imx hc3qlaCPj1ym.SxkXVV4vr8nI4UuiC_pkXJagIPfm7eIVa5YH_dyOhcpUKdi rJLYUOfw6eTHySc5qYiGEjbwu4jIzwqclM8G7DDRNIiehaC7quHw8YMXZDXc zeof0nr0RnxenxieWGgqauQxMmxNkvAKNf6aeppMksUeTZA-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <20170731005933.18904-1-danielsh@tarpaulin.shahaf.local2> From: Oliver Kiddle References: <20170731005933.18904-1-danielsh@tarpaulin.shahaf.local2> To: zsh-workers@zsh.org Subject: Re: [PATCH] _git: Complete files after 'reset' when there are no commits, when the 'verbose' style is set. MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14080.1501971067.1@thecus.kiddle.eu> Date: Sun, 06 Aug 2017 00:11:07 +0200 Message-ID: <14081.1501971067@thecus.kiddle.eu> On 31 Jul, Daniel Shahaf wrote: > diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git > index ce8a4049d..032cbad1e 100644 > --- a/Completion/Unix/Command/_git > +++ b/Completion/Unix/Command/_git > @@ -1462,6 +1462,12 @@ _git-reset () { > case $state in > (file) > local tree=HEAD > + if zstyle -t :completion:${curcontext}: verbose; then > + if ! _call_program headed git rev-parse --verify HEAD 2>/dev/null; then Was this supposed to assign the output of git rev-parse to $tree because this is currently spewing the hash into the terminal? Note _call_program should do the stderr redirection for you. Patch below does this and adds a few new options for git 2.14. Oliver diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 032cbad1e..518e6d198 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -628,6 +628,7 @@ _git-clone () { '*--shallow-exclude=[shallow clone excluding commits reachable from specified remote revision]:revision' \ '(--no-single-branch)--single-branch[clone only history leading up to the main branch or the one specified by -b]' \ '(--single-branch)--no-single-branch[clone history leading up to each branch]' \ + "--no-tags[don't clone any tags and make later fetches not follow them]" \ '--shallow-submodules[any cloned submodules will be shallow]' \ '--recursive[initialize all contained submodules]' \ '--recurse-submodules=-[initialize submodules in the clone]::file:__git_files' \ @@ -1454,6 +1455,7 @@ _git-reset () { '(--soft --mixed --merge --keep -p --patch -- *)--hard[match the working tree and index to the given tree]' \ '(--soft --mixed --hard --keep -p --patch -- *)--merge[reset out of a conflicted merge]' \ '(--soft --mixed --hard --merge -p --patch -- *)--keep[like --hard, but keep local working tree changes]' \ + '--recurse-submodules=-[control recursive updating of submodules]::reset:__git_commits' \ '(-p --patch)'{-p,--patch}'[select diff hunks to remove from the index]' \ '(-q --quiet)'{-q,--quiet}'[suppress all output]' \ '(--soft --mixed --hard --merge --keep):: :__git_commits' \ @@ -1463,7 +1465,7 @@ _git-reset () { (file) local tree=HEAD if zstyle -t :completion:${curcontext}: verbose; then - if ! _call_program headed git rev-parse --verify HEAD 2>/dev/null; then + if ! tree=$(_call_program headed git rev-parse --verify HEAD); then # well-known sha1 of the empty tree tree=4b825dc642cb6eb9a060e54bf8d69288fbee4904 fi @@ -1721,9 +1723,10 @@ _git-status () { fi _arguments -S -s \ - '(-s --short --column --no-column)'{-s,--short}'[output in short format]' \ + '(-s --short --column --no-column --show-stash)'{-s,--short}'[output in short format]' \ $branch_opts \ '(-s --short)--porcelain=-[produce machine-readable output]:version:(v1)' \ + '(-s --short)--show-stash[show stash information]' \ '(-u --untracked-files)'{-u-,--untracked-files=-}'[show untracked files]::mode:((no\:"show no untracked files" \ normal\:"show untracked files and directories" \ all\:"also show untracked files in untracked directories (default)"))' \ @@ -3372,6 +3375,7 @@ _git-filter-branch () { # such. # TODO: * should be git-rev-arg and git-rev-list arguments. _arguments -S -A '-*' \ + '--setup[specify one time setup command]: :_cmdstring' \ '--env-filter[filter for modifying environment in which commit will be performed]: :_cmdstring' \ '--tree-filter[filter for rewriting tree and its contents]: :_cmdstring' \ '--index-filter[filter for rewriting index]: :_cmdstring' \ @@ -3643,6 +3647,7 @@ _git-repack () { '--window=[number of objects to consider when doing delta compression]:number of objects' \ '--window-memory=[scale window size dynamically to not use more than specified amount of memory]: : __git_guard_bytes' \ '--depth=[maximum delta depth]:maximum delta depth' \ + '--threads=[limit maximum number of threads]:threads' \ '--max-pack-size=-[maximum size of each output packfile]: : __git_guard_bytes "maximum pack size"' \ '--pack-kept-objects[repack objects in packs marked with .keep]' }