-
Notifications
You must be signed in to change notification settings - Fork 251
fix(files): fixes #78, correctly handle .gitignore #83
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
Conversation
This is the draft I mentioned in #78, cleaned up. It checks any directory scanned for a .gitignore file and only creates a file item if the file/directory isn't ignored. There are mainly three cases that isn't handled right now:
|
|
One major issue I notice with this is that it is storing the filters as global state. We can easily have multiple trees open in different tabs which each need their own state. I would make |
Yeah, will do. I think manually parsing out .gitignore files is problematic, and will cause a lot of issues. Relying on git to do it is a lot safer, and easier, i.e. |
Absolutely, I think the You likely noticed this as well, but just to be sure: I noticed is that when a directory is ignored, it is only returning the directory and not the file contents, which is great because something like Thanks for working on this, I think the end result is going to be great! |
+1 to this. I've seen Regardless, it definitely seems better to let |
Changed the implementation to use There's no need to use separate filters for directories and files, it can easily be handled as one filter. I also moved the status flagging from |
Plenary's scandir only checks for .gitignore files in the directories it scans. Since directories are only scanned when opened any .gitignore in any parent directory isn't applied. Implements parsing the output of `git status --ignored=matching`.
It looks great, but when I tried it out I keep getting this error on every navigate/refresh:
I'm not sure what causes it yet. |
Of course, the problem went away when I added some log messages, and now it's not repeating. I will keep using this throughout my workday and see what happens. |
@levouh I'm not sure about |
I found the problem! The error shows reliably when in a repository with no changes. Classic Heisenbug, as soon as you start working on it, it goes away. |
Weird, that worked for me previously, but when I tested it now, I had the same error as you. I must have screwed up my testing somehow. Just pushed a fix for it. |
It is so awesome to finally have a functional gitgnore option. I don't think any of the trees I have used in the past did this correctly. I'll use the it for the day and release tonight if there are no issues. Thanks @jgottzen ! |
Plenary's scandir only checks for .gitignore files in the directories it
scans. Since directories are only scanned when opened any .gitignore in
any parent directory isn't applied.
Implements handling of .gitignore files anywhere in the tree. The parsing
and checking logic is copied from the Plenary implementation.