首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Zsh和git-flow错误

Zsh和git-flow错误
EN

Stack Overflow用户
提问于 2012-10-11 13:48:34
回答 1查看 797关注 0票数 0

我正在尝试使用哦-my-zsh git-flow插件,但得到了以下错误。

代码语言:javascript
复制
➜  ~/www/ git:(develop) git flow feature feature
flags:FATAL zsh shwordsplit option is required for proper zsh operation

这是插件的问题吗?或者是配置问题?

编辑:使用setopt shwordsplit无济于事

代码语言:javascript
复制
➜  ~/www/ git:(develop) ✗ setopt shwordsplit 
➜  ~/www/ git:(develop) ✗ git flow feature  
flags:FATAL zsh shwordsplit option is required for proper zsh operation

编辑2:使用set -x

代码语言:javascript
复制
(k3)➜  ~  git flow feature
+_per-directory-history-addhistory:1> print -sr -- git flow feature
+_per-directory-history-addhistory:2> fc -p /home/gaurav/.directory_history/home/gaurav/history
+_per-directory-history-addhistory:1> print -sr -- git flow feature
+_per-directory-history-addhistory:2> fc -p /home/gaurav/.directory_history/home/gaurav/history
+_per-directory-history-addhistory:1> print -sr -- git flow feature
+_per-directory-history-addhistory:2> fc -p /home/gaurav/.directory_history/home/gaurav/history
+_per-directory-history-addhistory:1> print -sr -- git flow feature
+_per-directory-history-addhistory:2> fc -p /home/gaurav/.directory_history/home/gaurav/history
+_per-directory-history-addhistory:1> print -sr -- git flow feature
+_per-directory-history-addhistory:2> fc -p /home/gaurav/.directory_history/home/gaurav/history
+omz_termsupport_preexec:1> emulate -L zsh
+omz_termsupport_preexec:2> setopt extended_glob
+omz_termsupport_preexec:3> local 'CMD='
+omz_termsupport_preexec:4> title '' '%100>...>git flow feature%<<'
+title:1> [[ '' == true ]]
+title:1> [[ '' == *term* ]]
+title:4> [[ xterm == screen* ]]
+title:6> [[ xterm == xterm* ]]
+title:7> print -Pn '\e]2;%100\>...\>git\ flow\ feature%\<\<\a'
+title:8> print -Pn '\e]1;\a'
+/usr/bin/zsh:1310> git flow feature
flags:FATAL zsh shwordsplit option is required for proper zsh operation
+omz_termsupport_precmd:1> title '%15<..<%~%<<' %n@%m: '%~'                                                                                                                                                                           
+title:1> [[ '' == true ]]
+title:1> [[ '' == *term* ]]
+title:4> [[ xterm == screen* ]]
+title:6> [[ xterm == xterm* ]]
+title:7> print -Pn '\e]2;%n@%m:\a'
+title:8> print -Pn '\e]1;%15\<..\<%~%\<\<\a'
+/usr/bin/zsh:1311> git_prompt_info
+git_prompt_info:1> ref=+git_prompt_info:1> git symbolic-ref HEAD
+git_prompt_info:1> ref='' 
+git_prompt_info:1> return

编辑2:有关设置的更多信息

代码语言:javascript
复制
(k3)➜  K3 git:(feature/ebay_listings) ls -l /bin/sh
lrwxrwxrwx 1 root root 12 Oct  7 22:12 /bin/sh -> /usr/bin/zsh
(k3)➜  K3 git:(feature/ebay_listings) ls -l /usr/bin/zsh 
lrwxrwxrwx 1 root root 28 Oct  2 13:49 /usr/bin/zsh -> /etc/alternatives/zsh-usrbin
(k3)➜  K3 git:(feature/ebay_listings) ls -l /bin/zsh
lrwxrwxrwx 1 root root 21 Oct  2 13:49 /bin/zsh -> /etc/alternatives/zsh
(k3)➜  K3 git:(feature/ebay_listings) ls -l /etc/alternatives/zsh-usrbin 
lrwxrwxrwx 1 root root 9 Oct  2 13:49 /etc/alternatives/zsh-usrbin -> /bin/zsh4
(k3)➜  K3 git:(feature/ebay_listings) ls -l /bin/zsh4 
-rwxr-xr-x 1 root root 688656 Mar 30  2012 /bin/zsh4
(k3)➜  K3 git:(feature/ebay_listings) ls -l /etc/alternatives/zsh
lrwxrwxrwx 1 root root 9 Oct  2 13:49 /etc/alternatives/zsh -> /bin/zsh4
(k3)➜  K3 git:(feature/ebay_listings) /bin/sh -c 'echo $0 B$BASH_VERSION Z$ZSH_VERSION'
/bin/sh B Z4.3.17
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-10-12 00:50:23

在错误消息中完全解释了配置问题:

要进行正确的zsh操作,需要使用

zsh shwordsplit选项

。您必须将setopt shwordsplit添加到您的zshrc中。更好的方法是让git-flow的作者相信这个选项是不方便的:如果设置command $var,如果var是标量,可能会导致命令被调用时带有任意数量的参数(取决于字符串中有多少空格/制表符/换行符),您必须改为键入command "$var"。Without:有1,等于$var

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12833000

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档