Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't show anything #377

Closed
habamax opened this issue Oct 8, 2016 · 22 comments
Closed

Doesn't show anything #377

habamax opened this issue Oct 8, 2016 · 22 comments

Comments

@habamax
Copy link

habamax commented Oct 8, 2016

I have a lot of changes in a git repo but no visual indication at all.

Win10, vim8.

I have tried to GitGutterEnable/Disable but nothing happens.

@airblade
Copy link
Owner

airblade commented Oct 8, 2016

Does it work with let g:gitgutter_async=0 in your vimrc?

@habamax
Copy link
Author

habamax commented Oct 9, 2016

yes, it works!

@habamax habamax closed this as completed Oct 9, 2016
@habamax habamax reopened this Oct 9, 2016
@linuxenko
Copy link

The same on vim8 but with linux. It does not highlight changes realtime. When i run GitGutterToggle a couple of times it showing + - and status line, all is cool but it does not updates until next bunch toggles i make. Configuration such as g:async, eager, realtime does not affect anything.

@airblade
Copy link
Owner

airblade commented Nov 3, 2016

@linuxenko What does :GitGutterDebug produce?

Please can you add let g:gitgutter_log=1 to your vimrc, run gitgutter while it doesn't work properly, then post the log file you'll find in gitgutter's installation directory?

@linuxenko
Copy link

@airblade , i cannot copy directly from GitGutterDebug window, because it blinks and so buggy .. i made a screenshot when it stop blinks
screen

@Gonzih
Copy link

Gonzih commented Nov 13, 2016

I get similar problem. Gitgutter shows hunks on start, but does not update them afterwards.

Here is my GitGutterDebug output. I don't know why it's almost empty, am I doing something wrong? I have gitgutter_log set to 1.


VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 30 2016 15:27:09)
Included patches: 1-55
Compiled by Arch Linux

git version 2.10.2

updatetime=4000
shell=/usr/bin/bash
shellcmdflag=-c
shellpipe=2>&1| tee
shellquote=
shellredir=>%s 2>&1
shellslash [n/a]
shelltemp=1
shelltype [n/a]
shellxescape=
shellxquote=

@airblade
Copy link
Owner

@Gonzih With let g:gitgutter_log=1, you'll find the log file in the directory where you installed vim-gitgutter.

@Gonzih
Copy link

Gonzih commented Nov 14, 2016

So I was rewriting my vimrc to use Shougo/dein.vim and after that gitgutter suddenly works. No idea what was the problem, but I guess it was my setup. Sorry about the noise then.

@airblade airblade closed this as completed Dec 6, 2016
@bimlas
Copy link

bimlas commented Dec 22, 2016

Same problem on Win7 + Vim 8.0.124 + Git 2.11.0

Output of GitGutterDebug:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Dec  4 2016 23:08:04)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-124

git version 2.11.0.windows.1

grep (GNU grep) 2.26
# SAME AS @LINUXENKO'S GREP OUTPUT

updatetime=1000
shell=C:\Windows\system32\cmd.exe
shellcmdflag=/c
shellpipe=>%s 2>&1
shellquote=
shellredir=>%s 2>&1
shellslash=0
shelltemp=1
shelltype [n/a]
shellxescape="&|<>()@^
shellxquote=(

The log file is

==== start log session ====
  0.119291 : ERROR: E329: No menu "&Buffers"
  0.119461 : ERROR: E328: Menu only exists in another mode
  0.152634 RECV on 0: '.vimrc
'
  0.152661 RECV on 0: 'grep: : No such file or directory
'
  0.152669 : looking for messages on channels
  0.152711 on 0: Invoking channel callback gitgutter#async#handle_diff_job_vim
  0.453068 ERR on 0: channel_handle_events(): Read error from ch_part[1], closing
  0.453168 ERR on 0: channel_handle_events(): Read error from ch_part[2], closing
  0.453203 : looking for messages on channels
  0.453224 on 0: Closing channel because all readable fds are closed
  0.453244 on 0: Closing channel
  0.453269 on 0: Invoking callbacks before closing
  0.453289 on 0: Invoking close callback gitgutter#async#handle_diff_job_vim_close
  0.484582 on 0: Dropping message 'grep: : No such file or directory
'
  0.484644 on 0: Job ended
  0.484658 on 0: Freeing job
  0.584360 : looking for messages on channels
  0.584406 on 0: Closing channel
  0.584418 on 0: Clearing channel
  0.584431 on 0: Freeing channel
  0.652982 : looking for messages on channels
 18.946453 : ERROR: E117: Unknown function: context_filetype#version
 19.027267 : looking for messages on channels

The interesting part is:

  0.152661 RECV on 0: 'grep: : No such file or directory

I think it runs grep without filename parameter.

@airblade
Copy link
Owner

Does it work if you add let s:grep_available=0 after this line?

@bimlas
Copy link

bimlas commented Dec 22, 2016

Yes, it gets working. 👍

@airblade
Copy link
Owner

airblade commented Dec 22, 2016 via email

@bimlas
Copy link

bimlas commented Dec 22, 2016

Sorry, I forgot to use minimal .vimrc - the problem is the same, but remember for this if viewing my previous outputs.

I using a minimal .vimrc from now:

set nocompatible
filetype plugin indent on
syntax enable
let $PATH = $PATH . ';c:/app/git/usr/bin'
let g:gitgutter_log = 1
set runtimepath+=$HOME/.vim/plugins/vim-gitgutter

So the log is:

==== start log session ====

  0.000032 function gitgutter#process_buffer[10]..gitgutter#diff#run_diff[75]..gitgutter#async#execute[51]:
  0.000032 [vim job: {'status': 'run', 'stoponexit': 'term', 'exitval': 0, 'exit_cb': 0, 'channel': channel 0 open, 'process': 6880}, buffer: 1] cd . && (git ls-files --error-unmatch .vimrc && (git -c "diff.autorefreshindex=0" diff --no-ext-diff --no-color -U0   -- .vimrc | grep --color=never -e "^@@ " || exit 0))

  0.731516 function gitgutter#async#handle_diff_job_vim[1]:
  0.731516 channel: channel 0 open, line: .vimrc

  0.832373 function gitgutter#async#handle_diff_job_vim_close[1]:
  0.832373 channel: channel 0 buffered

  0.834403 function gitgutter#async#handle_diff_job_vim_close[11]..gitgutter#handle_diff[1]:
  0.834403 .vimrc

Grep is on my PATH (using Msys-Git's version) and I can call :!grep.

Setting g:gitgutter_grep_command = 'grep -e' does not effects the behaviour.

@bimlas
Copy link

bimlas commented Dec 22, 2016

An interesting thing is what I execute it (cd . && (git ls-files --error-unmatch .vimrc && (git -c "diff.autorefreshindex=0" diff --no-ext-diff --no-color -U0 -- .vimrc | grep --color=never -e "^@@ " || exit 0))) via :! it works and the result is

.vimrc
@@ -893 +893 @@ if isdirectory(g:pm_dir)

@airblade
Copy link
Owner

airblade commented Dec 22, 2016 via email

@bimlas
Copy link

bimlas commented Dec 22, 2016

Yes, it works (this is how I using for now).

@airblade
Copy link
Owner

airblade commented Dec 22, 2016 via email

@bimlas
Copy link

bimlas commented Dec 22, 2016

Finally found the solution, the problem is in Vim:

let cmd_arg = 'cd . && (git ls-files --error-unmatch readme.adoc && (git -c "diff.autorefreshindex=0" diff --no-ext-diff --no-color -U0 -- readme.adoc | grep --color=never -e "^@@ " || exit 0))'

" let cmd = ['cmd.exe', "/c", cmd_arg]                          " FAIL
" let cmd = 'cmd.exe /c'.cmd_arg                                " OK
" let cmd = &shell.' '.&shellcmdflag.' '.shellescape(cmd_arg)   " FAIL
let cmd = &shell.' '.&shellcmdflag.' '. cmd_arg               " OK
" SEEMS TO BE A PROBLEM WITH SHELLESCAPE.

func! OutHandler(channel, line)
  echomsg 'ch_info: ' . string(ch_info(a:channel))
  echomsg 'ch_read: ' . ch_read(a:channel)
  echomsg 'line:    ' . a:line
endfunc
func! CloseHandler(channel)
  echomsg 'ch_info: ' . string(ch_info(a:channel))
  " echomsg 'ch_read: ' . ch_read(a:channel)
endfunc
call ch_logfile('channel.log', 'w')
let job = job_start(cmd, {
      \ 'out_cb':   'OutHandler',
      \ 'close_cb': 'CloseHandler'
      \ })

FAIL means the same "grep" output. You have the solution - unfortunatelly commented out.

airblade added a commit that referenced this issue Dec 23, 2016
Specifying the command as a list seems to be less reliable.

See #377.
@airblade
Copy link
Owner

Excellent! Thanks for the test case and the results.

I have updated the plugin – please could you confirm it works out of the box, i.e. without disabling grep or the async processing?

@bimlas
Copy link

bimlas commented Dec 23, 2016

Works for me, but don't forget that the issue is/was exists on Linux too as @linuxenko reported. I'm curious about her experiment.

@elliotf
Copy link

elliotf commented Apr 5, 2019

I found this while trying to figure out what was going on with my gitgutter not showing anything, and it turned out the root cause was that there were too many diffs, but for whatever reason the feedback that vim-gitgutter gave was hard for me to see, but I ended up increasing the max via: let g:gitgutter_max_signs = 2000

@jacint-mihaly-david
Copy link

For me the issue was that I had in my set.lua this line:
vim.opt.signcolumn = "no"

changed "no" to "yes" and it works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants