Skip to content

fix(#2168): Tree not reloading #2194

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

Closed
wants to merge 2 commits into from

Conversation

dmehala
Copy link

@dmehala dmehala commented May 7, 2023

The PR contains:

The issue

is_folder_ignored used to process the input in two steps. First, check the path against kernel filesystems with vim.startswith, then against any entry in the configuration file using vim.fn.match.

With #2012, kernel filesystems and user ignored directories share the same list and are fed to vim.fn.match. At that point I think you understand the issue, I forgot to transform the kernel filesystem entries to regex pattern. That lead to any path containing "/dev", "/sys" and "/proc" falsely marked as ignored.

Damien Mehala and others added 2 commits May 7, 2023 16:46
* Improve $GIT_DIR handling

- Retrieve $GIT_DIR using `git rev-parse --absolute-git-dir`
- Move $GIT_DIR ignore in the project exploration part

Resolves nvim-tree#1976

* Code review

- move norm_path to utils.lua
- fix comment nvim-tree#2012

* add comments for utils.norm_path

* get_git_directory use norm_path from utils

* watcher improvements

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
`is_folder_ignored` uses LUA pattern to detect if a directory should be ignore or not. Unfortunately, rules on kernel filesystems was not restrictive enough, which lead to any path containing "/sys", "/proc" or "/dev" considered to be ignored.
@alex-courtis
Copy link
Member

Thanks @dmehala , soaking for a week.

@alex-courtis
Copy link
Member

I have encountered an issue with regular file system watchers not updating the tree following a git commit.

I'll enable logging and try to replicate.

@alex-courtis
Copy link
Member

I just do not know what to do here:
I'm not able to get to the bottom of the issue I've seen only twice.
I don't want to release this and experience another regression.

Options to reduce the blast radius:

  1. Release this as an experiment: Experimental Features - Git Async - Enabled #2104
  2. Put this behind an option

I'm leaning towards 2, as it removes the extra git invocation for users that don't use it.

    *nvim-tree.git.respect_git_dir*
    Attempt to resolve `$GIT_DIR`, falling back to `.git`
      Type: `boolean`, Default: `false`

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

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

Let's put this one behind an option please.

@alex-courtis alex-courtis mentioned this pull request Jun 11, 2023
4 tasks
@alex-courtis
Copy link
Member

I reckon this is fixed by #2263

We can reopen if needed.

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.

2 participants