sodapopcan / vim-twiggy

Git branch management for Vim
280 stars 15 forks source link

Error when trying run :Twiggy #7

Open mcmillion opened 6 years ago

mcmillion commented 6 years ago
Error detected while processing function twiggy#Branch[14]..<SNR>130_Render[38]..<SNR>130_standard_view[10]..twiggy#get_branches[4]..<SNR>130_get_uniq_branch_names_from_reflog[5]..<SNR>130_system:
line   11:
E484: Can't open file /var/folders/vq/bbwtqs6s3wl3hpbzqwt1dvnc0000gn/T/vAMUQsA/16

I've installed it via Plug. Fugitive is installed as well. I'm on macOS.

sodapopcan commented 6 years ago

Is there anything on the two lines before that error as well? Like an Error detected while processing [...] line or anything?

mcmillion commented 6 years ago

Oh, sorry about that, I updated the original issue with the full three lines I see.

sodapopcan commented 6 years ago

I ~creeped~ looked through your dotfiles repo and saw you have set shell=sh in your .vimrc. I set the same on mine machine and was able to reproduce the problem. The culprit is a system call to awk that includes process substitution which is not posix-compliant.

I need to read up more on a possible workaround. So far, this gives a possible solution but still relies on making assumptions about the user's system. My shell-scripting chops are not a strong point of mine but this is a good excuse to learn more.

Changing set shell=sh to set shell=/bin/bash (or simply bash) fixes the issue. Obviously it needs to be fixed in the plugin but I'm just offering as a very temporary solution if you just want to check out the plugin quickly.

Thanks a lot for reporting!

mcmillion commented 6 years ago

Changing it to zsh (which is what I actually use) also appears to work for now. Awesome! Thanks for the help!

sodapopcan commented 6 years ago

I also use zsh but have vim's shell setting set to bash (on macOS). It's been so long I can't remember what wasn't working, but there were some programs that weren't being run correctly without this setting. I saw you had a note about RVM and zsh when setting your shell to sh—I suspect this might be the same? Maybe it's a non-issue these days.

In any event, if you want vim to just use your default shell, you don't have to set shell at all.

weilbith commented 6 years ago

With zsh its fine, but working on a Windows machine lead t a similar problem.

Error detected while processing function #twiggy#Branch[14]..<SNR>189_Render[37]..<SNR>189_no_commits[1]..<SNR>189_git_cmd[6]..<SNR>189_system:
line 11:
E484: Can't open file C:\Users\username\AppData\Local\Temp\VIo41DC.tmp
Error detected while processing BufWinLeave Auto commands for "twiggy://*":
E108: No such variable:  "t:twiggy_git_mode"
sodapopcan commented 6 years ago

D'oh. I've been dreading/kinda-looking-forward to the first Windows issue. I don't actually have access to a Windows machine so it makes trouble-shooting this a little problematic for me.

I was actually planning on just removing the offending command if bash isn't available. This would only mean losing the ability sort by "most recently used (checked-out)" but everything else should still work.

Of course, this looks like it might be something different.

I honestly don't even know what a typical Windows Vim set up looks like. Are you using cygwin or, uh, WSL it it? I should just get a Windows laptop, heh. I can try the bandage fix I suggested above and see how it goes. I won't be able to do so until later this evening, though.

weilbith commented 6 years ago

Yeah, I'm forced to use Windows sometimes and I like to have my favorite editor there. I've this in my configuration:

if has("win32")
   set shell=cmd.exe " For working on MS-Windows
elseif if filereadable("/bin/zsh")
   set shell=/bin/zsh " Private use case
else
   set shell=/bin/bash " Fallback for servers without zsh
endif

Setting the Windows case to something like C:\Users\weilb00t\AppData\Local\Programs\Git\git-bash.exe or C:\cygwin64\bin\mintty.exe doesn't work at all. It looks like GVim/Plugins send commands depending on the OS and not shell, so both get in trouble, cause they can't handle the MS-DOS commands.

sodapopcan commented 6 years ago

Great, thanks for the info. I didn't have to time to get to it last night and due to some poor planning between job transitions will be without a computer for a few days. And of course have to figure out a Windows set up, haha. I'll see what I can do.

weilbith commented 6 years ago

Don't hurry. This isn't an essential tool. If u've time I will be happy about that. Else its okay also. But maybe a comment in the readme and/or documentation would be good, I guess.

sodapopcan commented 6 years ago

Haha, I know, just trying to stay on top of stuff (this is my only os project with anything resembling traction so may as well). I'll get back to ya next week.

jasonmorganson commented 4 years ago

I'm on MacOS. I don't have shell set, but I tried with and without it. Also tried with vim and neovim.

Getting a different error trying to call :Twiggy

Error detected while processing function twiggy#Branch[14]..<SNR>187_Render[62]..<SNR>187_standard_view[10]..twiggy#get_branches[82]..<SNR>187__git_branch_vv[11]..<SNR>187_parse_branch: line 70: E684: list index out of range: 5 E116: Invalid arguments for function join E15: Invalid expression: join([pieces[2], pieces[5]], ' ') Error detected while processing function twiggy#Branch[14]..<SNR>187_Render: line 62: E712: Argument of extend() must be a List or Dictionary

minusf commented 4 years ago

i am also getting a shell error when selecting a branch:

/usr/local/bin/mksh: syntax error: unexpected '('

this seems like a simple escaping issue. is there an easy way to see which command is failing? something like a debug mode?

swember commented 4 years ago

I'm having a similar problem after the last update. Before it worked fine. I'm on macos and I don't have shell set. Here is the error output

Error detected while processing function twiggy#Branch[14]..<SNR>139_Render[62]..<SNR>139_standard_view[10]..twiggy#get_branches[82]..<SNR>13
9__git_branch_vv[11]..<SNR>139_parse_branch:
line   13:
E684: list index out of range: 3
E15: Invalid expression: pieces[3] . ' ' . pieces[4]
Error detected while processing function twiggy#Branch[14]..<SNR>139_Render:
line   62:
E712: Argument of extend() must be a List or Dictionary
swember commented 4 years ago

I managed to fix the problem I described earlier. The problem was that I had a warning warning: ignoring broken ref refs/remotes/origin/HEAD when git branch -r was called. Fixing this has fixed Twiggy.