Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: small nit about zsh vcs_info module
- X-seq: zsh-workers 28093
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Michel Lespinasse <walken@xxxxxxxxxx>
- Subject: Re: small nit about zsh vcs_info module
- Date: Mon, 19 Jul 2010 20:53:25 +0200
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <20100718224326.GA13145@xxxxxxxxxx> (Michel Lespinasse's message of "Sun, 18 Jul 2010 15:43:26 -0700")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20100718121846.GA15276@xxxxxxxxxx> <87oce4v7t0.fsf@xxxxxxxxxxxxxxxxxxxxxx> <20100718224326.GA13145@xxxxxxxxxx>
Michel Lespinasse wrote:
> On Sun, Jul 18, 2010 at 10:44:43PM +0200, Frank Terbeck wrote:
[...]
>> How about this?
>> ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules HEAD 2>/dev/null
>> (( $? && $? <= 127 )) && gitstaged=1
>>
>> or maybe even (( $? && $? != 128 ))
>
> (( $? && $? != 128 )) looks good & works fine for me.
I'll commit the following then. Thanks!
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 778d061..9765a6e 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -121,8 +121,8 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-changes" && \
# 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
+ (( $? && $? != 128 )) && gitstaged=1
fi
VCS_INFO_adjust
Messages sorted by:
Reverse Date,
Date,
Thread,
Author