From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28203 invoked by alias); 10 Aug 2010 18:13:55 -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: 28138 Received: (qmail 19189 invoked from network); 10 Aug 2010 18:13:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at benizi.com designates 64.130.10.15 as permitted sender) From: "Benjamin R. Haskell" To: Zsh Workers Cc: "Benjamin R. Haskell" Subject: [PATCH] _git: Don't cause errors if git isn't installed Date: Tue, 10 Aug 2010 14:13:45 -0400 Message-Id: <1281464025-24258-1-git-send-email-zsh@benizi.com> X-Mailer: git-send-email 1.7.1 Setting up a new system under Cygwin on Windows 7, one of the first things I tried (out of habit) was git. I'm not sure this is the 'right' way to patch it, but other not-installed commands didn't seem to cause the same kinds of errors: $ screen # no extra output $ php # no extra output $ git (eval):1: command not found: git (eval):1: command not found: git By "not the 'right' way", I just mean that this version accomplishes the goal of eliminating the error messages, but maybe a more-correct solution would be to replace some/all of the $(git...)-style calls with $(_call_program [tag] git...)? Best, Ben --- Completion/Unix/Command/_git | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 465b316..b7eb681 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -30,6 +30,7 @@ # zstyle ':completion::*:git-{name-rev,add,rm}:*' ignore-line true _git() { +(( $+commands[git] )) || return 1 local nul_arg abbrev_arg find_copies_harder_arg diff_l_arg pretty_arg exec_arg local author_conversion_file_arg long_author_conversion_file_arg verbose_arg local help_arg template_arg shared_arg thin_arg author_conversion_file_arg_spec -- 1.7.1