Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
small nit about zsh vcs_info module
- X-seq: zsh-users 15190
- From: Michel Lespinasse <walken@xxxxxxxxxx>
- To: ft@xxxxxxxxxxxxxxxxxxx
- Subject: small nit about zsh vcs_info module
- Date: Sun, 18 Jul 2010 05:18:46 -0700
- Cc: zsh-users@xxxxxxx
- 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==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author