-
-
Notifications
You must be signed in to change notification settings - Fork 582
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
skip-gitignore walks all files, including ignored ones #1895
Comments
Hello @bmalehorn thanks for such a detailed ticket! To be honest, I don't have much context on why this was done like this but if I have to argue for the present implementation it would be that Please raise if there's anything I might have gotten wrong and I would love to discuss this further and hear any other perspectives on this. ~ Aniruddha |
Hey @anirudnits, let me elaborate a bit more now that I have a better understanding of the code. First, ignoring symlinks is a useful heuristic for some repos, but common package managers like About Here's how it works currently:
The plan for how to implement it would be:
I made a pull request here to show you what it would look like: #1900 Does that all make sense? |
Hi, I'm looking into a performance issue with isort.
It seems that when you pass in
--skip-ignore
and a directory, it will:isort/isort/settings.py
Lines 555 to 586 in c6a4196
In my use case, my subdirectory has 8 files. But before checking those, isort will first enumerate all 8 million untracked files in the entire repo, which takes several minutes!
There are a couple potential fixes:
os.walk
, and instead rungit ls-files
. This gets all tracked files (which there's a lot less of) instead of getting all untracked files and filteringos.walk
in the subdirectory you're running in, instead of the entire git repoI'd be happy to prep a PR fixing this issue, but I want to see if that makes sense or if there's other considerations I'm not taking into account.
Reproduction
_check_folder_gitignore
:Actual output:
Expected output:
or maybe even this, since I only passed in
src
:Related
These PRs are related to inclusion rules, but are specifically about symlinks: #1772, #1788
The text was updated successfully, but these errors were encountered: