Skip to content

fix: don't populate git status when git unused #499

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

Merged
merged 2 commits into from
Jul 10, 2021
Merged

fix: don't populate git status when git unused #499

merged 2 commits into from
Jul 10, 2021

Conversation

w0ng
Copy link
Contributor

@w0ng w0ng commented Jul 9, 2021

Attempts to fix #453

On large git repos, git status related commands are very slow. Do not populate git status when not set in configuration.

in nvim config:

vim.g.nvim_tree_gitignore = 0
vim.g.nvim_tree_git_hl = 0
vim.g.nvim_tree_show_icons = {
  git = 0,
}

When cd'd into my huge git repo:

$ time git -C . status --porcelain=v1 --ignored=matching
git -C . status --porcelain=v1 --ignored=matching  6.12s user 39.51s system 737% cpu 5.513 total

Before fix

before_fix

After fix

after_fix

@w0ng w0ng mentioned this pull request Jul 9, 2021
Copy link
Member

@kyazdani42 kyazdani42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be better to run use git every time we need it so users can change configuration options on the fly and reload?

@w0ng
Copy link
Contributor Author

w0ng commented Jul 10, 2021

wouldn't it be better to run use git every time we need it so users can change configuration options on the fly and reload?

👍 SGTM. Fixed ab76632

@w0ng w0ng requested a review from kyazdani42 July 10, 2021 07:13
Copy link
Member

@kyazdani42 kyazdani42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@kyazdani42 kyazdani42 merged commit 64aacb6 into nvim-tree:master Jul 10, 2021
Almo7aya pushed a commit to Almo7aya/nvim-tree.lua that referenced this pull request Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Significant lag on start
2 participants