From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23667 invoked by alias); 6 Aug 2017 17:01:21 -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: 41494 Received: (qmail 20453 invoked by uid 1010); 6 Aug 2017 17:01:20 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.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(66.111.4.25):SA:0(-0.7/5.0):. Processed in 3.858664 secs); 06 Aug 2017 17:01:20 -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.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Yvnf5H Q56jBEKODuGByhHzNSJNUFToWCW8phH98VSZ8=; b=hzSuIqwkeoieoJQk3grV// pB1YzgASY1gZpxymNAlEldRSvozIyvFXMqtsoZhBh7YEOokfr/vhsUiwnJIF9xCH MdIxUeD+8KwJllIKEmO1gaBYtHlNON38QYHESBaeC0XjkzQ6LrggeNaAiRW/1C/M E02CB0LEKB8zm+vHdzG6J2zfBhR4Wgq5XXshLmssdGCD70mldQ48jHTfdIvVoUsN 1SYA6v5xwyNV7E0fU3T0vBmIZ3TdFb34EFk6AKSEHy48JQ78UT/ZOoR4IZHWSG/h 2gqQGTRLL7rVKGvTMnOBKuoowbq6zLymKYQOhETBAKswgUUBGN8C1PG20nvPpyHw == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Yvnf5H Q56jBEKODuGByhHzNSJNUFToWCW8phH98VSZ8=; b=pOk2XntxGh7CR2xhwe4eNW ryJ3joY/c+BoslrVne1BMHO2q6JhOOmhHluyrIWDsdmv8YNzJfsatg3Vhj1vO3nx XgMfD8jdB30EjAG+k6TWGRj4VmQmwPMOMyNllst34nrxA5E2ppEn90CmbEl40Xfz N5vNQ4vCh6U1laFo/8m3AfjKLm4N9vmX45dM3MOkvK1jN8U+7BQQ1yeFnmbRcxgF gJx+sZBKhnp+pyhhvoVMU5Zxmo2D3Q7wk8zFimK1Oi0vwIkaCxxAkUXYbvbU/ML7 lXRRtD890GCsFFm0psOZJ+jBQPDvilcVpCUBLOSg0QwXHBqEDzTXSw8i6/0U5V1w == X-ME-Sender: Message-Id: <1502038870.3035333.1064794864.46025A40@webmail.messagingengine.com> From: Daniel Shahaf To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-7b2cde4a Date: Sun, 06 Aug 2017 17:01:10 +0000 Subject: Re: [PATCH] _git: Complete files after 'reset' when there are no commits, when the 'verbose' style is set. In-Reply-To: <14081.1501971067@thecus.kiddle.eu> References: <20170731005933.18904-1-danielsh@tarpaulin.shahaf.local2> <14081.1501971067@thecus.kiddle.eu> Oliver Kiddle wrote on Sun, 06 Aug 2017 00:11 +0200: > On 31 Jul, Daniel Shahaf wrote: > > +++ 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 > No, it was not. I wanted to check whether HEAD refers to a commit, and for that, only the command's exit value matters. > because this is currently spewing the hash into the terminal? The code would be correct either with the assignment you implemented, or with additionally redirecting stdout to /dev/null. > Note _call_program should do the stderr redirection for you. > *nod*. I didn't test without the 2>/dev/null redirection. > Patch below does this and adds a few new options for git 2.14. Thanks for fixing. Cheers, Daniel