zsh-workers
 help / color / mirror / code / Atom feed
From: Marco Hinz <mh.codebro@gmail.com>
To: zsh-workers@zsh.org
Subject: Problem with VCS_INFO's disable-patterns
Date: Thu, 9 Oct 2014 13:28:17 +0200	[thread overview]
Message-ID: <20141009112817.GA8289@cheyenne> (raw)

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_


             reply	other threads:[~2014-10-09 11:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09 11:28 Marco Hinz [this message]
2014-10-09 16:09 ` [PATCH] vcs_info: Make sure maxexports is set with VCS_INFO_set is called Frank Terbeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141009112817.GA8289@cheyenne \
    --to=mh.codebro@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).