airblade / vim-gitgutter

A Vim plugin which shows git diff markers in the sign column and stages/previews/undoes hunks and partial hunks.
MIT License
8.35k stars 296 forks source link

GitGutter not working on Ubuntu 19.10 (Vundle Plugin) #686

Closed neoben closed 4 years ago

neoben commented 4 years ago

What is the latest commit SHA in your installed vim-gitgutter? Installed via Vundle plugin

What vim/nvim version are you on? VIM - Vi IMproved 8.1 (2018 May 18, compiled Mar 19 2020 13:12:18)

Hello! I have a vim GitGutter plugin installed via Vundle which is not working on my Ubuntu 19.10 while it is working perfectly fine on my Ubuntu 18.04.

Here it is some details about the software I'm running:

Ubuntu 18.04 VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41) grep (GNU grep) 3.1

Ubuntu 19.10 VIM - Vi IMproved 8.1 (2018 May 18, compiled Mar 19 2020 13:12:18) grep (GNU grep) 3.3

I'm using the same vimrc file on both machines with the following plugins installed:

" My Plugins
Plugin 'VundleVim/Vundle.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'valloric/youcompleteme'
Plugin 'git://github.com/tomasr/molokai.git'
Plugin 'git://github.com/whatyouhide/vim-gotham.git'
Plugin 'git://github.com/NLKNguyen/papercolor-theme.git'
Plugin 'git://github.com/ajh17/Spacegray.vim.git'
Plugin 'git://github.com/DrSpatula/vim-buddy.git'
Plugin 'tpope/vim-fugitive'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'mhinz/vim-startify'
Plugin 'git://github.com/scrooloose/syntastic.git'
Plugin 'scrooloose/nerdcommenter'
Plugin 'wakatime/vim-wakatime'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'

GitGutterDebug

VIM - Vi IMproved 8.1 (2018 May 18, compiled Mar 19 2020 13:12:18)
Included patches: 1-875, 878, 884, 948, 1046, 1365-1368, 1382, 1401
Modified by team+vim@tracker.debian.org

git version 2.20.1

grep (GNU grep) 3.3\00Copyright (C) 2018 Free Software Foundation, Inc.\00License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\00This is free software: you are free to change and redistribute it.\00There is NO WARRANTY, to the extent permitted by law.\00\00Written by Mike Haertel and others; see\00<https://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
Usage: grep [OPTION]... PATTERNS [FILE]...Search for PATTERNS in each FILE.Example: grep -i 'hello world' menu.h main.cPATTERNS can contain multiple patterns separated by newlines.Pattern selection and interpretation:  -E, --extended-regexp     PATTERNS are extended regular expressions  -F, --fixed-strings       PATTERNS are strings  -G, --basic-regexp        PATTERNS are basic regular expressions  -P, --perl-regexp         PATTERNS are Perl regular expressions  -e, --regexp=PATTERNS     use PATTERNS for matching  -f, --file=FILE           take PATTERNS from FILE  -i, --ignore-case         ignore case distinctions  -w, --word-regexp         match only whole words  -x, --line-regexp         match only whole lines  -z, --null-data           a data line ends in 0 byte, not newlineMiscellaneous:  -s, --no-messages         suppress error messages  -v, --invert-match        select non-matching lines  -V, --version             display version information and exit      --help                display this help text and exitOutput control:  -m, --max-count=NUM       stop after NUM selected lines  -b, --byte-offset         print the byte offset with output lines  -n, --line-number         print line number with output lines      --line-buffered       flush output on every line  -H, --with-filename       print file name with output lines  -h, --no-filename         suppress the file name prefix on output      --label=LABEL         use LABEL as the standard input file name prefix  -o, --only-matching       show only nonempty parts of lines that match  -q, --quiet, --silent     suppress all normal output      --binary-files=TYPE   assume that binary files are TYPE;                            TYPE is 'binary', 'text', or 'without-match'  -a, --text                equivalent to --binary-files=text  -I                        equivalent to --binary-files=without-match  -d, --directories=ACTION  how to handle directories;                            ACTION is 'read', 'recurse', or 'skip'  -D, --devices=ACTION      how to handle devices, FIFOs and sockets;                            ACTION is 'read' or 'skip'  -r, --recursive           like --directories=recurse  -R, --dereference-recursive  likewise, but follow all symlinks      --include=GLOB        search only files that match GLOB (a file pattern)      --exclude=GLOB        skip files and directories matching GLOB      --exclude-from=FILE   skip files matching any file pattern from FILE      --exclude-dir=GLOB    skip directories that match GLOB  -L, --files-without-match  print only names of FILEs with no selected lines  -l, --files-with-matches  print only names of FILEs with selected lines  -c, --count               print only a count of selected lines per FILE  -T, --initial-tab         make tabs line up (if needed)  -Z, --null                print 0 byte after FILE nameContext control:  -B, --before-context=NUM  print NUM lines of leading context  -A, --after-context=NUM   print NUM lines of trailing context  -C, --context=NUM         print NUM lines of output context  -NUM                      same as --context=NUM      --color[=WHEN],      --colour[=WHEN]       use markers to highlight the matching strings;                            WHEN is 'always', 'never', or 'auto'  -U, --binary              do not strip CR characters at EOL (MSDOS/Windows)When FILE is '-', read standard input.  With no FILE, read '.' ifrecursive, '-' otherwise.  With fewer than two FILEs, assume -h.Exit status is 0 if any line (or file if -L) is selected, 1 otherwise;if any error occurs and -q is not given, the exit status is 2.Report bugs to: bug-grep@gnu.orgGNU grep home page: <http://www.gnu.org/software/grep/>General help using GNU software: <https://www.gnu.org/gethelp/>

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

Thank you!

airblade commented 4 years ago

Is Vundle fetching the repo from GitHub? I'm curious why some of your plugins are declared as user/repo and some as a git url.

Anyway, please could you turn on logging on your broken version (:let g:gitgutter_log=1), do something which should make a sign show up, then post the log file you'll find in the directory where gitgutter is installed? Thank you.

neoben commented 4 years ago

I think it is fetching from the GitHub repo but I'm not totally sure since I didn't dig into Vundle implementation. This is the reference I'm following: https://vimawesome.com/plugin/vim-gitgutter

I will provide the log you requested ASAP. Thank you!

neoben commented 4 years ago

gitgutter.log

==== start log session ====

  0.000024 function gitgutter#process_buffer[21]..gitgutter#diff#run_diff[83]..gitgutter#async#execute[1]:
  0.000024 [async] cd /home/neoben/workspace/fluidmesh/fmrepo/3200/buildroot/package/utils/fm-scripts/files/fluidmesh && (git  --no-pager show :buildroot/package/utils/fm-scripts/files/fluidmesh/class.php > /tmp/vK5Ed6v/4.1.2.php && git  --no-pager  -c "diff.autorefreshindex=0" -c "diff.noprefix=false" -c "core.safecrlf=false" diff --no-ext-diff --no-color -U0  -- /tmp/vK5Ed6v/4.1.2.php /tmp/vK5Ed6v/5.1.2.php | grep '^@@ ' || exit 0)

  0.038233 function <SNR>108_on_exit_vim[11]..gitgutter#diff#handler[1]:
  0.038233 @@ -648,0 +649 @@ class nodeStatus

channel.log

==== start log session ====
  0.000299 : Starting job: sh  -c  cd /home/neoben/workspace/fluidmesh/fmrepo/3200/buildroot/package/utils/fm-scripts/files/fluidmesh && (git  --no-pager show :buildroot/package/utils/fm-scripts/files/fluidmesh/class.php > /tmp/vK5Ed6v/4.1.2.php && git  --no-pager  -c "diff.autorefreshindex=0" -c "diff.noprefix=false" -c "core.safecrlf=false" diff --no-ext-diff --no-color -U0  -- /tmp/vK5Ed6v/4.1.2.php /tmp/vK5Ed6v/5.1.2.php | grep '^@@ ' || exit 0)
  0.000332 on 11: Created channel
  0.008686 : looking for messages on channels
  0.037007 RECV on 11(out): '@@ -648,0 +649 @@ class nodeStatus
'
  0.037026 on 11: Invoking channel callback <SNR>108_on_stdout_vim
  0.037817 on 11: channel_select_check(): Read EOF from ch_part[1], closing
  0.037864 on 11: channel_select_check(): Read EOF from ch_part[2], closing
  0.037887 : looking for messages on channels
  0.037898 on 11: Closing channel because all readable fds are closed
  0.037907 on 11: Closing channel
  0.037923 on 11: Invoking callbacks and flushing buffers before closing
  0.037934 on 11: Invoking close callback <SNR>108_on_exit_vim
  0.038016 on 11: Job exited with 0
  4.010443 : looking for messages on channels
  4.013047 on 11: Freeing job
  4.013082 on 9: Freeing job
  4.013098 on 8: Freeing job
  4.013121 on 11: Closing channel
  4.013133 on 11: Clearing channel
  4.013146 on 11: Freeing channel
  4.013157 on 9: Closing channel
  4.013167 on 9: Clearing channel
  4.013177 on 9: Freeing channel
  4.013187 on 8: Closing channel
  4.013196 on 8: Clearing channel
  4.013207 on 8: Freeing channel
  4.013288 on 5: Freeing job
  4.013342 on 4: Freeing job
  4.014286 on 5: Closing channel
  4.014305 on 5: Clearing channel
  4.014329 on 5: Freeing channel
  4.014341 on 4: Closing channel
  4.014400 on 4: Clearing channel
  4.014427 on 4: Freeing channel
  4.014484 : looking for messages on channels

I also checked the version used and fetched by Vundle plugin and at the moment I'm running the following commit:

commit 0e509fb0ac56b24203800a1fab35162c8da9c9b4 (HEAD -> master, origin/master, origin/HEAD)
Author: Andy Stewart <boss@airbladesoftware.com>
Date:   Thu Mar 12 10:38:58 2020 +0000

    Set diff base when viewing file versions with Fugitive

    When you look at previous versions of a file, e.g. with Fugitive's
    :0Gclog, gitgutter will set the diff base to the current version's
    parent so that diff markers appear as expected.

    Thannks to @rcreasi for the idea and initial implementation.

Thank you!

airblade commented 4 years ago

Presumably you had added a single line at line 648?

class nodeStatus

The git-diff side all looks fine.

Your updatetime is still at the default value of 4000 (i.e. 4 seconds). I'd suggest changing that to, say, 100.

neoben commented 4 years ago

SMALL NOTE: after enabling logging it started working but it seems to be very slow.

neoben commented 4 years ago

Presumably you had added a single line at line 648?

class nodeStatus

The git-diff side all looks fine.

Your updatetime is still at the default value of 4000 (i.e. 4 seconds). I'd suggest changing that to, say, 100.

I see, thank you! How can I change the updatetime value?

airblade commented 4 years ago

In your vimrc: set updatetime=100

Or when vim is running: :set updatetime=100.

neoben commented 4 years ago

It is working fine. I think we can mark the issue as closed. Thanks a lot!