-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Unable to clone remote repository with a clone path > 255 chars #2576
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
Comments
This issue is in reference to the issue #2075 , I could not find a solution there, hence created a new issue. |
Does it work if you use |
No, it results with the same fatal error: Unable to create temporary file : Filename too long There is one more observation, I have tried a
|
And in all those cases, I won't lie, there is a very good chance that I won't get to this anytime soon. Do you have some experience with C? I could guide you through debugging and fixing this, is the best I can do in the foreseeable future. |
I was applying I only have some theoretical knowledge (college) in C. I could try it if you don't mind guiding me or point me to the right direction. |
Yeah, there is a catch-22 right there. If the config itself cannot be read... because it would need the setting that's in the config... it simply won't work. I guess that we cannot really support that use case. However, |
My bad, I used After setting the global property, I should be able to access the local git config? That is the unexpected behavior. (git init and git fetch both work fine in the same local repository) |
I would think so, yes. Maybe you can build Git and then run it in |
So I have built Git and I can run it in |
It is too short-lived to attach it via normal use. If you use the Otherwise, start the command in GIT_DEBUGGER=1 /usr/src/git/bin-wrappers/git ... |
So here is what I tried:
Command: git init
|
Didn't you say earlier that |
Yes, when I tried the same experiment explained in the issue description, I'm not sure myself if this is because of the experiment I am performing or git-for-windows fault. |
What is strange in the gdb debugging experiment, the clone path isn't even 255 chars long, it is shorter than that, it would be greater than that after cloning the remote repository (18 chars). Would you like me to debug further? |
@dscho apologies, it is because of the experiment. The clone path was already >260 chars hence git init was not working. This the new experiment:
Error stack:
|
What is the value of the global variable |
For:
|
No, I meant in memory. The question is whether the config setting has been parsed at that point, or not yet. |
Okay, so I put a breakpoint at compat/mingw.c:
|
So what you're saying is that the global variable is set when the If so, it would be good to study the code in |
I'm not sure if I understand you correctly, I'll explain what I did if you feel it is wrong, please point it out.
|
@rishabhBudhouliya what I meant was inspecting the value of
in |
Also, the code that acts on /* CreateDirectoryW path limit is 248 (MAX_PATH - 8.3 file name) */ I suspect that that is the culprit. IIRC Maybe you can experiment with this a bit, to see whether this is the actual culprit? |
Sure, I'll try to investigate this section of code using the debugger. |
Yes, that means that the config setting is read correctly, and that the code that should handle long paths is misbehaving. |
Could it be that we are limited in the path name length because of |
While looking at the error stack, there is an issue with creating a temporary file. Lines 1205 to 1207 in db1835b
doesn't work for long paths, is that useful? Also, from Windows v1607, |
The crucial tid-bit is "if you opt-in". You have to opt-in, and you have to do that in a manner that does not break Git for Windows on older Windows versions. |
@tboegi I suspect exactly that. |
`The problem is deeper than that. diff --git a/git-compat-util.h b/git-compat-util.h
index 6c3dd4a5dd..d06f7980ab 100644
--- a/git-compat-util.h
+++ b/git- compat-util.h
@@ -315,6 +315,9 @@ char *gitdirname(char *);
#define NI_MAXSERV 32
#endif +#if defined(GIT_WINDOWS_NATIVE)
+#undef PATH_MAX
+#endif compiling & installing, I went into another "Git SDK 64 bit" window:
|
@tboegi I fixed your comment, it was rendered all over the place, totally unreadable. |
@tboegi I think if we create a potential working directory of char >260 before launching git, git.exe would fail to launch because Windows doesn't allow that. (without longpaths enabled) |
Closing as stale. |
Setup
defaults?
to the issue you're seeing?
** Nothing that I can think of**
Details
Git Bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
A fresh repository cloned in my local file system
fatal: Unable to create temporary file 'C:/Users/techn/AppData/Local/Temp/mdyshjeqvvvkiotkhiimoqkhwjlmgqrdwwzhnrwlsimanqdqeutjmqcwnyprzzjftejzfjvvjknbsxoswabqdnbsbqnbnclnhbnvoewqnslobjqszcinqbpibonqbandlftxf14739883836305635481/zedtlkgruqbrdlhijcmwdltgocurldhkcxzjqlutteqqpljllmpofmhmkm/git-client-p': Filename too long
The text was updated successfully, but these errors were encountered: