-
Notifications
You must be signed in to change notification settings - Fork 5
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
Really long windows dirs #38
base: master
Are you sure you want to change the base?
Really long windows dirs #38
Conversation
@@ -291,7 +292,10 @@ class Repository | |||
if err | |||
reject err | |||
if stderr?.length > 0 | |||
reject stderr | |||
if isWindows and stderr.length > windowsMaxPathLength | |||
resolve(stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the error thrown in this case? The result still comes from the stdout? Just files with path < 260?
If I'm right, maybe we need to put a comment here specifying that the error is probably something related to a big file path.
Whats leads us to: is there anything in the error message that could specify it better than its length being greater than 260 chars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, it ain't pretty.
The problem is that the error is just a string
/path/that/is/long could not find file or somesuch
The problem is that there is no error code or somesuch and windows error message could be localized, so I can't match the string.
Given that windows-paths can also contain spaces I'm not quite sure how to reliably recognize the situation.
The only case I could think of is deliberately trying to cause the error at startup with a well-known directory and saving 'the rest of the string'. But that sounds like a little bit too much work for such a small edge-case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very much open to suggestions though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 'could not find file' in stderr
a better solution than stderr.length > 260
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that works since the error message could be localized, so if I had the dutch language pack enabled it would be 'bestand kon niet gevonden worden' or somesuch.
...there's got to be a better way though.
Finally had a free hour to fix #37