From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22922 invoked by alias); 18 Jul 2010 12:29:58 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15190 Received: (qmail 5302 invoked from network); 18 Jul 2010 12:29:56 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.121.35 as permitted sender) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1279455535; bh=kYgawDGO/l+gsCIFQ9S1wyy2ca4=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=ZAWH47DvwFZK67077jTiCf9raanFhW1eRUHZoM3iy6ZreTXvthBF5zlglWpZZbCvh yrrVEMnnPh5UNF0HwYR1w== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=date:from:to:cc:subject:message-id:mime-version: content-type:content-disposition:user-agent:x-system-of-record; b=vX0mRIuvsycqkQ+yEZoN5yAmF873UE5/J0O4zguskhaMJ8T4AiXXx6DKAkbinzeoH NvQXyD9LT8UjDrRu8Ugug== Date: Sun, 18 Jul 2010 05:18:46 -0700 From: Michel Lespinasse To: ft@bewatermyfriend.org Cc: zsh-users@zsh.org Subject: small nit about zsh vcs_info module Message-ID: <20100718121846.GA15276@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-System-Of-Record: true Hi, I recently started using your vcs_info module & I love it :) I wanted to report a small nit I have about it. Right after creating a new git repository with 'git init', vcs_info reports that there are staged files in it. This is because .git/HEAD points to refs/heads/master, which does not exist anymore, so git diff-index return code is 128. Following patch fixes the issue for me: --- VCS_INFO_get_data_git.orig 2010-07-18 04:57:55.000000000 -0700 +++ VCS_INFO_get_data_git 2010-07-18 05:00:49.000000000 -0700 @@ -139,8 +139,8 @@ # Default: off - these are potentially expensive on big repositories ${vcs_comm[cmd]} diff --no-ext-diff --ignore-submodules --quiet --exit-code || gitunstaged=1 - ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules HEAD || - gitstaged=1 + ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules HEAD 2>/dev/null + [[ $? -eq 1 ]] && gitstaged=1 fi VCS_INFO_adjust Hope this helps. Thanks for writing the vcs_info module ! -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.