* Problem with VCS_INFO's disable-patterns
@ 2014-10-09 11:28 Marco Hinz
2014-10-09 16:09 ` [PATCH] vcs_info: Make sure maxexports is set with VCS_INFO_set is called Frank Terbeck
0 siblings, 1 reply; 2+ messages in thread
From: Marco Hinz @ 2014-10-09 11:28 UTC (permalink / raw)
To: zsh-workers
Hi,
Problem
=======
I have the following in my zshrc:
zstyle ':vcs_info:*' disable-patterns '/data/linux/stable(|/*)'
Now, when I switch to that directory or any of its subfolders, I get the
following error:
VCS_INFO_set:typeset:11: not valid in this context: vcs_info_msg_-1_
When vcs_info() is executed, $maxexports apparently is 0 at:
https://github.com/zsh-users/zsh/blob/master/Functions/VCS_Info/vcs_info#L97
Then, in the loop {0..-1} gets expended and fails at typeset:
https://github.com/zsh-users/zsh/blob/master/Functions/VCS_Info/VCS_INFO_set#L10-L11
Possible solution
=================
The line before the loop contains:
[[ $2 == '-preinit-' ]] && (( maxexports == 0 )) && (( maxexports = 1 ))
The condition for '-preinit-' is probably there on purpose, but for my
problem case (where $2 doesn't exist), this would work fine:
(( maxexports == 0 )) && (( maxexports = 1 ))
But that probably doesn't fix the root of the problem and breaks stuff
in other cases.
--
Github: http://github.com/mhinz | Twitter: http://twitter.com/_mhinz_
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] vcs_info: Make sure maxexports is set with VCS_INFO_set is called
2014-10-09 11:28 Problem with VCS_INFO's disable-patterns Marco Hinz
@ 2014-10-09 16:09 ` Frank Terbeck
0 siblings, 0 replies; 2+ messages in thread
From: Frank Terbeck @ 2014-10-09 16:09 UTC (permalink / raw)
To: zsh-workers; +Cc: Marco Hinz
Reported-by: From: Marco Hinz <mh.codebro@gmail.com>
---
Marco and I debugged this on IRC. The other calls to VCS_INFO_set --nvcs
should be fine.
Functions/VCS_Info/vcs_info | 1 +
1 file changed, 1 insertion(+)
diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info
index 5a421df..4693869 100644
--- a/Functions/VCS_Info/vcs_info
+++ b/Functions/VCS_Info/vcs_info
@@ -94,6 +94,7 @@ vcs_info () {
for pat in ${dps} ; do
if [[ ${PWD} == ${~pat} ]] ; then
+ VCS_INFO_maxexports
[[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --nvcs
return 0
fi
--
2.1.0.60.g85f0837
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-09 16:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-09 11:28 Problem with VCS_INFO's disable-patterns Marco Hinz
2014-10-09 16:09 ` [PATCH] vcs_info: Make sure maxexports is set with VCS_INFO_set is called Frank Terbeck
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).