-
Notifications
You must be signed in to change notification settings - Fork 220
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
The command line is too long
on Windows
#655
Comments
The command line is too long.
on WindowsThe command line is too long
on Windows
Hey! For Windows lefthook must split the long commands by 8000 symbols. Could you please check in the logs the length of the |
I piped the output onto a file, so things are easier to follow.
The length starts from Chunks 1-3 trigger the error, even though they are below the 800 symbol limit. I've tried this with Git Bash, Command Prompt, and PowerShell. I tried removing files from one of the chunks one by one and I got the command to execute at around 7262 symbols. I don't know whether this helps. If I understand correctly, the way it is done in lint-staged, the limit is split by 2 https://github.com/lint-staged/lint-staged/blob/master/lib/index.js#L74, so the end result is more but smaller chunks. Is this something that you believe can affect other people? |
Thank you. Yes, probably it would be better to set the chunk size a bit smaller. Let me decrease the limit down to 7000 symbols. I hope this will help. Will release the fix ASAP |
@ValentinGurkov , could you check 1.6.5 version? |
Thank you for responding this quickly, the fix worked wonderfully, even with more staged files! |
🔧 Summary
Hello,
I am testing the project with leftook instead of husky + lint-staged. I happen to have another formatting changes and the list of staged files is 365.
This seems to be already discussed inhttps://github.com//issues/471 and fixed in #541 but chunking of the input files did not happen.
I am currently testing with a very simple configuration like:
cspell
can be replaced with another package likeprettier
for example. As long asstaged_files
are used and the number of files are long enough (I don't know where is the breaking point), this issue will occur.Have I missed something to trigger the chunking?
Thanks.
Lefthook version
1.6.4
Steps to reproduce
Expected results
The command should be split into multiple commands with each with a chunk of files.
Actual results
The command line is too long.
Possible Solution
Logs / Screenshots
Here is the error from
pnpm lefthook run pre-commit --verbose
. I have omitted the list of files, the project, and stashes. I did not see anything else in the log but it is possible it got trimmed in my terminal due to the long output.The text was updated successfully, but these errors were encountered: