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

current_line_blame causes lag in large repos, leave orphaned git blame processes #783

Closed
classabbyamp opened this issue Apr 10, 2023 · 0 comments · Fixed by #834
Closed
Labels
bug Something isn't working

Comments

@classabbyamp
Copy link

Description

in a large repository like void-linux/void-packages, the current_line_blame function can cause lots of lag when moving around in a file and after closing it, because of long-running git blame invocations.

a small sample (sorry for the large image):
image

Neovim version

NVIM v0.9.0

Operating system and version

Void Linux

Expected behavior

ideally, this wouldn't happen, but it seems unavoidable. However, if there could be some config option for either turning off current_line_blame when the path matches a glob, or a "kill git after x delay" option, that could minimise the issue.

Actual behavior

git processes accumulate and eventually take over all CPU time

Minimal config

vim.o.packpath = '/tmp/nvim/site'

local plugins = {
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
}

for name, url in pairs(plugins) do
  local install_path = '/tmp/nvim/site/pack/test/start/'..name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
end

require('gitsigns').setup{
  debug_mode = true, -- You must add this to enable debug messages
  current_line_blame = true,
}

Steps to reproduce

  1. git clone https://github.com/void-linux/void-packages.git
  2. cd void-packages
  3. nvim --clean -u minimal.lua srcpkgs/bash/template
  4. move around the file a bunch
  5. watch git processed pile up
  6. quit nvim, and watch the git processes stick around for some time

Gitsigns debug messages

signs.init: Using vimfn signs
dprintf: Deriving GitSignsAdd from DiffAdd
dprintf: Deriving GitSignsChange from DiffChange
dprintf: Deriving GitSignsDelete from DiffDelete
dprintf: Deriving GitSignsChangedelete from GitSignsChange
dprintf: Deriving GitSignsTopdelete from GitSignsDelete
dprintf: Deriving GitSignsUntracked from GitSignsAdd
dprintf: Deriving GitSignsAddNr from GitSignsAdd
dprintf: Deriving GitSignsChangeNr from GitSignsChange
dprintf: Deriving GitSignsDeleteNr from GitSignsDelete
dprintf: Deriving GitSignsChangedeleteNr from GitSignsChangeNr
dprintf: Deriving GitSignsTopdeleteNr from GitSignsDeleteNr
dprintf: Deriving GitSignsUntrackedNr from GitSignsAddNr
dprintf: Deriving GitSignsAddLn from DiffAdd
dprintf: Deriving GitSignsChangeLn from DiffChange
dprintf: Deriving GitSignsChangedeleteLn from GitSignsChangeLn
dprintf: Deriving GitSignsUntrackedLn from GitSignsAddLn
dprintf: Deriving GitSignsStagedAdd from GitSignsAdd
dprintf: Deriving GitSignsStagedChange from GitSignsChange
dprintf: Deriving GitSignsStagedDelete from GitSignsDelete
dprintf: Deriving GitSignsStagedChangedelete from GitSignsChangedelete
dprintf: Deriving GitSignsStagedTopdelete from GitSignsTopdelete
dprintf: Deriving GitSignsStagedAddNr from GitSignsAddNr
dprintf: Deriving GitSignsStagedChangeNr from GitSignsChangeNr
dprintf: Deriving GitSignsStagedDeleteNr from GitSignsDeleteNr
dprintf: Deriving GitSignsStagedChangedeleteNr from GitSignsChangedeleteNr
dprintf: Deriving GitSignsStagedTopdeleteNr from GitSignsTopdeleteNr
dprintf: Deriving GitSignsStagedAddLn from GitSignsAddLn
dprintf: Deriving GitSignsStagedChangeLn from GitSignsChangeLn
dprintf: Could not derive GitSignsStagedDeleteLn
dprintf: Deriving GitSignsStagedChangedeleteLn from GitSignsChangedeleteLn
dprintf: Could not derive GitSignsStagedTopdeleteLn
dprintf: Deriving GitSignsAddPreview from DiffAdd
dprintf: Deriving GitSignsDeletePreview from DiffDelete
dprintf: Deriving GitSignsCurrentLineBlame from NonText
dprintf: Deriving GitSignsAddInline from TermCursor
dprintf: Deriving GitSignsDeleteInline from TermCursor
dprintf: Deriving GitSignsChangeInline from TermCursor
dprintf: Deriving GitSignsAddLnInline from GitSignsAddInline
dprintf: Deriving GitSignsChangeLnInline from GitSignsChangeInline
dprintf: Deriving GitSignsDeleteLnInline from GitSignsDeleteInline
dprintf: Deriving GitSignsDeleteVirtLn from DiffDelete
dprintf: Deriving GitSignsDeleteVirtLnInLine from GitSignsDeleteLnInline
attach(1): Attaching (trigger=setup)
run_job: git --version
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 config user.name
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 rev-parse --show-toplevel --absolute-git-dir --abbrev-ref HEAD
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git -c core.quotepath=off ls-files --stage --oth
ers --exclude-standard --eol /home/abi/void/packages/srcpkgs/bash/template
watch_gitdir(1): Watching git dir
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git show :0:srcpkgs/bash/template
update(1): updates: 1, jobs: 5
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git blame --contents - -L 1,+1 --line-porcelain 
/home/abi/void/packages/srcpkgs/bash/template
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git blame --contents - -L 14,+1 --line-porcelain
 /home/abi/void/packages/srcpkgs/bash/template
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git blame --contents - -L 28,+1 --line-porcelain
 /home/abi/void/packages/srcpkgs/bash/template
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git blame --contents - -L 31,+1 --line-porcelain
 /home/abi/void/packages/srcpkgs/bash/template
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git blame --contents - -L 37,+1 --line-porcelain
 /home/abi/void/packages/srcpkgs/bash/template
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git blame --contents - -L 41,+1 --line-porcelain
 /home/abi/void/packages/srcpkgs/bash/template
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git blame --contents - -L 54,+1 --line-porcelain
 /home/abi/void/packages/srcpkgs/bash/template
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git blame --contents - -L 60,+1 --line-porcelain
 /home/abi/void/packages/srcpkgs/bash/template
run_job: git --no-pager --literal-pathspecs -c gc.auto=0 --git-dir /home/abi/void/packages/.git blame --contents - -L 38,+1 --line-porcelain
 /home/abi/void/packages/srcpkgs/bash/template
cli.run: Running action 'debug_messages' with arguments {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant