-
Notifications
You must be signed in to change notification settings - Fork 55
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
Git subprocess call error when too many files in directory, even if gitignore'd #490
Comments
Thanks @gesslerpd for the detailed report and analysis! Do you agree with my reasoning:
Do you know whether the limit in Windows is on the
Also, I wonder what the exact limit is and whether it's similar across Windows versions. |
Sorry for the delay, I was able to do some tests and it seems like the limit is to do with the amount of information in the args in total rather than the number of args, approximately Another thing I noticed is that when I have a I was initially thinking along the lines of your second bullet as a solution or possibly there's a way to only input the git |
Found this that seems to support my findings: https://devblogs.microsoft.com/oldnewthing/20031210-00/?p=41553 |
I must be misunderstanding something. Do you mean that gitignored paths are included but non-gitignored
There must then be code in Black which we could re-use in Darker. (Note: We'll probably want to vendor instead of import useful code from Black due to #251, #304 and #309. There are existing helper imports from Black which should be vendored as well.) |
Maybe it's just, because black will not use the Fix: #515 |
As per akaihola#490 when running darker on Windows with a large codebase subprocess fails to run with a large list of files. What I attempted to do in this commit is to only process changed files, seeing as this is all we care about anyway. The filtering of the files is moved earlier in the process and is passed the directory or paths set on the commandline, instead of the list of files returned from the `filter_python_files` call. The resulting set is then intersected with all the files Black would process to generate a list of files that should be processed. While this alleviates the symptom, it could potentially still break if a large amount of files are modified in between the current and previous revisions.
@gesslerpd & @Svenito, could you check whether #515 fixes this problem? |
Latest release 1.7.3 fixes it, thanks! @akaihola |
Describe the bug
On windows, when a repo has too many files in it (e.g. many virtual environments or installed dependencies installed) running
darker
results in the following error:The above error isn't due to a long filename as the
WinError
suggests, seems to be due to the amount of files passed to thesubprocess
call.To Reproduce
Steps to reproduce the behavior:
venv*/
to the.gitignore
filepython -m venv venv1 venv2 venv3 venv4 venv5 venv6
pip install darker isort -U
darker .
Expected behavior
Should not error out and not pass such a large list of files to
git
subprocess call (especially if they are gitignore'd)Environment (please complete the following information):
Additional context:
The
files_to_process
variable in__main__.py:562
contains files from all ignored venv's and exceeds the amount of process call arguments that are allowed by windows.The text was updated successfully, but these errors were encountered: