stage_fixed
: Couldn't stage fixed files:fork/exec C:\Program Files\Git\mingw64\bin\git.exe: The filename or extension is too long.
on Windows
#693
Labels
bug
Something isn't working
🔧 Summary
When I have a lot of staged files that got changed and must be re-added, the list of files
git add
seems to be too long and results in the error:Couldn't stage fixed files:fork/exec C:\Program Files\Git\mingw64\bin\git.exe: The filename or extension is too long.
For reference, the command I am running is:
With around 452 files, the length of the
git add ...
command is33852
characters long in my use case, which triggers the error,I gradually removed some files and at around 435 files, the
git add ...
command was32549
characters long in my use case and the command executed successfully.Lefthook version
1.6.8 96d2b329e43a04c9ea3f7fb138f1606e8c33cb41
Steps to reproduce
Have a lot of staged files that get changed during hook execution and have
stage_fixed: true
set for the command that will execute.With around 452 files, the length of the
git add ...
command is33852
characters long in my use case, which triggers the error.Expected results
git add
duringstage_fixed
should work regardless of the amount of staged files.Actual results
git add
can become too long and will not be executed.Possible Solution
I imagine like with #666 for the command length,
git add
can also be chunked.However, I cannot determine whether there will be any impact when tasks are run in parallel, hopefully, somebody else knows better.
Logs / Screenshots
The text was updated successfully, but these errors were encountered: