tpope / vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
https://www.vim.org/scripts/script.php?script_id=2975
20.01k stars 1.01k forks source link

:Gdiff hangs on Ubuntu 18.04 with vim 8 #1397

Closed gidgid closed 4 years ago

gidgid commented 4 years ago

I'm using Vim 8, Ubuntu 18.04 and zsh (oh-my-zsh) & vim plug When I open a file with a merge conflict and invoke :Gdiff vim suddenly hangs until I kill it using Ctrl + C

I tried without success:

Any ideas what I may have missed?

tpope commented 4 years ago

Check if there's a child git process running.

gidgid commented 4 years ago

Not sure if there are other ways to check this (I'll be happy to know if there are) but I tried the following and could not see any running git processes:

BTW, :Gdiff doesn't seem to work at all (regardless if I'm in a middle of a merge conflict or not)

The same problem also happens on my mac so maybe this is some vim configuration problem?

tpope commented 4 years ago

You can use px auxf to see if Vim has any child processes.

gidgid commented 4 years ago

I'm assuming you meant ps auxf Ran it and didn't see any vim child processes Anything else I should check?

gidgid commented 4 years ago

I kept digging into it and wanted to pour more information and it seems like all the diff capabilities suspend my vim (:Gdiff or :Gdiffsplit)

tpope commented 4 years ago

Does :Gsplit fail the same way? It does essentially the same thing except it doesn't enable diff mode.

gidgid commented 4 years ago

Just checked, :Gsplit works fine. I also tried using just vimdiff without Vim fugitive as a mergetool to resolve the merge conflict and it also works fine, so it seems like the problem is only with the different diff commands

tpope commented 4 years ago

You say this is happening during a merge conflict; does it happen outside of one? Does it happen on both :Gdiffsplit and :Gdiffsplit!?

gidgid commented 4 years ago

All the different diff command seem to not work for some reason. They don't work during a merge conflict or without a merge conflict I also check Gdiffsplit! which doesn't work as well

ezpuzz commented 4 years ago

I have hanging Gdiff on windows + Vim8 and I see continuous process spawning of git in process monitor.

tpope commented 4 years ago

@ezpuzz If there's any way you could figure out the arguments of that git process it could potentially narrow things down.

Other things to test:

gidgid commented 4 years ago

The first 2 commands (:Gdiffsplit :0:% and :Gdiffsplit HEAD:%) make my vim suspend but the last one does work (i.e. no suspend) - anything else I should check?

tpope commented 4 years ago

That strongly suggests to me another plugin or your vimrc has an autocommand that's hanging. Try disabling plugins and see if you can isolate it.

gidgid commented 4 years ago

I'm using vim-plug and removed all the plugins except from fugitive & vim plug. I ran :PlugClean and verified no other plugins are in my vim plug directory :Gdiff keeps suspending though Is there a way to make sure only fugitive is running?

gidgid commented 4 years ago

I cleaned out my entire .vimrc file and just left the plugins and now it works - so its probably something that is massed up with my configuration. I'll do a binary search and try and isolate the problem

gidgid commented 4 years ago

Found it! apparently I had some old code in my .vimrc related to some experiments I did with ctags a while back. Once I removed it, :Gdiff is working again Thanks a lot for your help - it is highly appreciated