From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14947 invoked by alias); 29 Mar 2014 09:54:57 -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: 32506 Received: (qmail 27266 invoked from network); 29 Mar 2014 09:54:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=mesmtp; bh= Oo0Z/DwsferRZarfdJBJuyR4zcU=; b=GwmV11qDthHqzNuK0MLFQqGeSynXsOX5 uhygheFRMkK5M5EzWShauPbf10/gJdEB733mnE1dUYUwCf8bLPF4SCCPgn8qBjN6 oEZ+oItblEvetzgai/fxFuch30Ipa/4Ktljk79aBfv1rD9SnuxbPinqHu420/zGx 4h9eXywVPT0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=Oo0Z/DwsferRZarfdJBJuyR4zcU=; b=AjNvUrmrvx/gKFxyifRGP+ouGomX QV8Kabt8VeMEgIfiwZCMS21yP1nDIa8w6+it/eLGo5RvYGzWUDBsBJFFWfkTdpqy 9zIJT2RkOZOa9uUepVateA4XB7y3oaP1Aj9h/K8hr5f4vcUEEnp27y0bW7tai9zN 2zimu23le978J7I= X-Sasl-enc: iCJEJP/vB0oiC/an2n1QFWGFRvl0UU1qONdmlg0YPyqI 1396086880 Date: Sat, 29 Mar 2014 09:54:37 +0000 From: Daniel Shahaf To: Nils Steinger Cc: zsh-workers@zsh.org Subject: Re: VCS_INFO_get_data_git produces output in git-annex directories Message-ID: <20140329095437.GC11569@tarsus.local2> References: <20140310183155.GB29473@voidptr.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140310183155.GB29473@voidptr.de> User-Agent: Mutt/1.5.21 (2010-09-15) Nils Steinger wrote on Mon, Mar 10, 2014 at 19:31:56 +0100: > Hi, > > I'm using oh-my-zsh and noticed that whenever I changed into a directory > containing a git-annex repository, "fatal: This operation must be run in > a work tree" appeared above my shell prompt. Would it be a better fix to change the if's condition to include 'git rev-parse --is-inside-work-tree'? I'm not sure whether that would break some other use-case, but avoiding a non-working case seems preferable to swallowing errors silently. Cheers, Daniel P.S. This patch conflicts with the one I just sent. The conflict is trivial (my patch just reindents the line your patch changes), but if both patches are applied then whoever applies the second one will run into it. > After unsuccessfully grep-ing the oh-my-zsh sources for a command that > could cause this output, I 'set -x' and found that the error message was > caused by line 119 in > /usr/share/zsh/functions/VCS_Info/Backends/VCS_INFO_get_data_git. > > I assume that's accidental (since it's useless and annoying) and have > attached a patch to fix this behavior. > > Nils > --- /usr/share/zsh/functions/VCS_Info/Backends/VCS_INFO_get_data_git.old 2014-03-10 18:16:33.514629788 +0000 > +++ /usr/share/zsh/functions/VCS_Info/Backends/VCS_INFO_get_data_git 2014-03-10 18:15:54.919823850 +0000 > @@ -116,7 +116,7 @@ > [[ "$(${vcs_comm[cmd]} rev-parse --is-inside-git-dir 2> /dev/null)" != 'true' ]] && \ > ${vcs_comm[cmd]} rev-parse --quiet --verify HEAD &> /dev/null ; then > # Default: off - these are potentially expensive on big repositories > - ${vcs_comm[cmd]} diff --no-ext-diff --ignore-submodules --quiet --exit-code || > + ${vcs_comm[cmd]} diff --no-ext-diff --ignore-submodules --quiet --exit-code &> /dev/null || > gitunstaged=1 > ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules HEAD 2> /dev/null > (( $? && $? != 128 )) && gitstaged=1 >