A way to disable git integration on certain paths #3184
-
When I'm in a root path containing hundreds subfolders which are not git projects, open another file in the root path will make the nvim-tree search every subfolder to check whether it's a git project. The opts.git.disable_for_dirs and opts.filesystem_watchers.ignore_dirs have nothing to do with this situation because of calling git.utils.get_toplevel hundreds times still costing a lot of time, especially for slow filesystems such as NFS. It's nice if opts.git.enable can accept a function similar to opts.filesystem_watchers.ignore_dirs that can disable git for certain matched regex paths. But I wonder whether there is another way to change the option of nvim-tree before I called NvimTreeOpen or NvimTreeToggle. Then I can do the path filter by my own. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
See discussion on toplevel here #3171 . It should not be called repeatedly, with the results cached instead.
Regardless of toplevel performance issues, this would be a valuable feature. Please raise a feature request so that we may schedule this work. As usual, pull requests are most gratefully appreciated, see |
Beta Was this translation helpful? Give feedback.
-
@przepompownia and @henry-hsieh I'd be most grateful if you thoroughly tested this fix branch #3185 which caches git toplevel for untracked directories. cd /path/to/nvim-tree.lua
git pull
git checkout 3171 When you're finished testing: git checkout master |
Beta Was this translation helpful? Give feedback.
Yes please. I will definitely use it, as my function is not elegant.