Get an error when I use standard git command:
[~/site]$ git branch
git:1: maximum nested function level reached
.zshrc:
plugins=(git osx colored-man gem brew go bundler rake rails)
source $ZSH/oh-my-zsh.sh
Get an error when I use standard git command:
[~/site]$ git branch
git:1: maximum nested function level reached
.zshrc:
plugins=(git osx colored-man gem brew go bundler rake rails)
source $ZSH/oh-my-zsh.sh
My mistake, I moved bash function to zsh:
gr() {
git rebase -i HEAD~$1
}
Solution:
function gr() {
git rebase -i HEAD~$1
}
I had the same error with a different command (export
), caused by an accidental recursive function definition. I could solve the problem by removing the unwanted function:
unset -f export
I had the same issue, with a different command: find
Don't invoke aliases to a function inside the function script.
$ find ~ -name some_thing
find_no_err:1: maximum nested function level reached; increase FUNCNEST?
find_no_err
), that use a command c (find
)alias c=f
# the recursion issue
c=f(c)
Avoid invoking aliases to functions or commands that call a given function inside its script
or, in the case of c=f(c)
, don't call c
form f
Instead, use one of this 3 options:
cmd
) ./cmd
# to get it, in linux systems, use
whereis cmd
'cmd'
I just quoted find invocation, inside the function body
find_no_err(){
'find' $* 2>/dev/null
}
then sourced the file (cf. zsh doc for "source file", cf. POSIX spec for "dot description")
the issues seem similars: a git call invokes a git alias/function that invokes its invoker ...
omz's git plugging , add a long list of git alias, among which there is
alias gr='git remote' # line 246
which may had some conflict with the OP custom function, after git branch call (but I don't see how)
adding the optional (cf. zsh doc) function
identifier, doesn't prevent the alias invocation within the function body (by default). that leads to the recursion issue, which throws "maximum nested function level reached;" error
You can unset
or remove the changes, as mentioned in bluenote10 answer
closing the terminal and reopening it, worked for me.
You can add command
to stop the recursion.
In my case I had this in my .zshrc
:
docker() {
docker $* # <-- recursive
if [[ ..
...
}
worked just fine after changing the docker
call to:
docker() {
command docker $*
...
}
© 2022 - 2024 — McMap. All rights reserved.