Skip to content

Find File: Extraneous git status #2293

Closed
@alex-courtis

Description

@alex-courtis

Description

When finding file a "git sync job" is performed for all directories up the tree. This is a performance problem.

Originating discussion: #2275

Neovim version

:; nvim --version
NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

Linux 6.3.9-arch1-1

nvim-tree version

3cc698b

Clean room replication

vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvt-min/site]]
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup {
    {
      "wbthomason/packer.nvim",
      "nvim-tree/nvim-tree.lua",
      "nvim-tree/nvim-web-devicons",
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  }
end
if vim.fn.isdirectory(install_path) == 0 then
  print "Installing nvim-tree and dependencies."
  vim.fn.system { "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path }
end
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]]
vim.opt.termguicolors = true
vim.opt.cursorline = true

-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
  require("nvim-tree").setup {}
end

Steps to reproduce

Clone git@github.com:torvalds/linux.git
Open nvim-tree
:e arch/powerpc/boot/dts/fsl/b4420qds.dt

[2023-06-25 14:03:44] [profile] START find file /home/alex/src/linux/arch/powerpc/boot/dts/fsl/b4420qds.dts
[2023-06-25 14:03:44] [profile] START refresh_nodes_for_path /home/alex/src/linux/arch/powerpc/boot/dts/fsl
[2023-06-25 14:03:44] [profile] START git sync job /home/alex/src/linux /home/alex/src/linux
[2023-06-25 14:03:44] [git] running job with timeout 400ms
[2023-06-25 14:03:44] [git] git --no-optional-locks status --porcelain=v1 -z --ignored=matching -u /home/alex/src/linux
[2023-06-25 14:03:44] [profile] END   git sync job /home/alex/src/linux /home/alex/src/linux 114ms
[2023-06-25 14:03:44] [git] job success    /home/alex/src/linux /home/alex/src/linux

...

[2023-06-25 14:03:44] [profile] END   reload /home/alex/src/linux/arch/powerpc/boot/dts/fsl 6ms
[2023-06-25 14:03:44] [profile] END   refresh_nodes_for_path /home/alex/src/linux/arch/powerpc/boot/dts/fsl 330ms
[2023-06-25 14:03:44] [profile] START draw
[2023-06-25 14:03:44] [profile] END   draw 14ms
[2023-06-25 14:03:44] [profile] END   find file /home/alex/src/linux/arch/powerpc/boot/dts/fsl/b4420qds.dts 345ms

Expected behavior

No response

Actual behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreproducedIssue confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions