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.34k stars 296 forks source link

Performance issues with big files in the repository #881

Closed dominx99 closed 7 months ago

dominx99 commented 7 months ago

What is the latest commit SHA in your installed vim-gitgutter?

67ef116

What vim/nvim version are you on?

Neovim v0.9.5

I am experiencing performance issues. Every time I open a file I have to wait couple of seconds (10-15)

I found that this process causes this:

git -c core.safecrlf=false diff --diff-filter=R --name-status

which is called by this plugin and it lasts so long because I have one big file in the repo (database) and I use git-lfs.

airblade commented 7 months ago

I've never used git-lfs but isn't it supposed to make normal git operations not be slowed down by a big file?

I think the right answer will be a way to exclude lfs-managed (or binary) files from git-diff, but I'm not sure how to do that.

It's a git problem rather than a plugin problem, I believe.

dominx99 commented 7 months ago

Thank you for hint

git update-index --assume-unchanged <filename>

worked for me

airblade commented 7 months ago

Thanks for posting your solution!