-
Notifications
You must be signed in to change notification settings - Fork 315
Long file names (length > 260) should have special prefix #24
Comments
For reference, we had a discussion about lifting the 260 character limit before on the mailing list: |
subscribing my @work account Archiving pastebin and jsfiddle logs: http://permalink.gmane.org/gmane.comp.version-control.msysgit/16367 However, apart from file length itself - the exit status is strange. I'd re-quote:
As far as got it, on UNIX git has 4KB length limit. |
Git only supports working directories up to 1024 characters (see abspath.c:27). This is probably for good reason, I don't know (so that hitting the 4k boundary on Unix is impossible?). Anyway, I can confirm that 'git clone' on Windows returns success even if some files could not be checked out correctly. This is probably worth fixing. However, supporting long path names in general is pointless as long as Windows shells and applications don't support this. Quote from the MSDN article linked above: "The shell and the file system have different requirements. It is possible to create a path with the Windows API that the shell user interface is not able to interpret properly." See also this discussion: http://thread.gmane.org/gmane.comp.version-control.msysgit/16284 |
The MSDN quotation is more about names like "12345 " or " 12345" I also have doubts about case-sensitive names. Whle the core supports it, i guess both GUi and CLI does not. Isn't it too early to declare somethign useless if some programs do not support it ? If developer needs it, he would find better program or push for bug fixing. But even if some obstaclle would be fatal to him - let it be obstacle in another program. As of now the showstopper is Git. Git can be pointed at and claimed obsolete. Not some other program. And Git can harder get replacement than filemanager. |
I don't think anyone actually declared it as useless, only warned about possible issues along the road if someone dares to go down this path. This is one of those issues you don't simply request and magically get granted, though. Someone who cares about it needs to pick it up and work on it. Luckily for whoever does (if any), Karsten's work on unicode pathnames already did a lot of the heavy lifting needed. |
Okay, cmd.exe does not work with it, so no cmd/bat scripts. I tried Notepad++ and it crashed, made bugreport. Java.exe finally read such files, hopefully any Java program as well |
Have you already tried paths that exceed the 260 limit even with 8.3 names? The problem is not Notepad++ (or any other editor / IDE, for that matter), it is Windows Explorer and the shell's common file open dialog that cannot handle long names. That means that practically all Windows programs that work with files are affected. That beeing said, there are a few workarounds that you might try:
|
+1 for this issue. It seems, that the underlying "old" cygwin has some influence. My test setup is Windows7 64bit "Git version 1.7.8-preview20111206". Additionally I've throwed in this command: Than I've checked the find command within cygwin (CYGWIN_NT-6.1-WOW64 momo 1.7.15(0.260/5/3) 2012-05-09 10:25 i686 Cygwin) So maybe just linking git against a newer cygwin should work? |
@kblees Have you already tried paths that exceed the 260 limit even with 8.3 names? I told you, "I launched empty N++ and did File|Open and... it was clever trick" Also both N++ and Delphi XE2 IDe mananged to read the file by 8.3 names Also command-line java.exe (as of JRE 7b05 x64) does access those files. What interesting is Java approach at dir traversal: log shows it opens each time from root to a subfolder, then to sub-sub-folder and so on, one by one. Hopefully that allows them to alleviate lack of relating paths in extended-length strings. |
If having no other choice and hopefully support from Tortoise, would try. Also, since Java works, i might be able to get this with Eclipse's Jit. Attempt at cloning failed, but maybe attempt to check-out would succeed.
Not the option i can make on 3rd-party repo.
Dunno how it is implemented. In DOS it was just a redirector after user code before actual File IO API. Well, it really seems to work even wit hrelative paths. C:\Users\burov>cd \fs160.src\xwiki-platform-core\xwiki-platform-classloader\xwik C:\fs160.src\xwiki-platform-core\xwiki-platform-classloader\xwiki-platform-class
C:\fs160.src\xwiki-platform-core\xwiki-platform-classloader\xwiki-platform-class
C:\fs160.src\xwiki-platform-core\xwiki-platform-classloader\xwiki-platform-class
L:>"c:\Notepad++\notepad++.exe" org\xwiki\classloader\internal\protocol\attachm L:>dir org\xwiki\classloader\internal\protocol\attachmentjar\AttachmentURLStrea Содержимое папки L:\org\xwiki\classloader\internal\protocol\attachmentjar\Attac 06.07.2012 15:47 2 482 DLL_Load_Test.dpr L:>type org\xwiki\classloader\internal\protocol\attachmentjar\AttachmentURLStre uses .......... |
Was it fixed ? or should extra ticket be created to make it not forgotten ? |
Is it a bug specific to Git for Windows? If so, are you experiencing issue #43? |
don't know, at least it was reproduced there above 404 #43 |
yes, happens in my Git-1.7.11-preview20120710.exe |
@the-Arioch kusma's question was whether you see "git clone" to report success although it fails when using the git wrapper from the "cmd" directory, or when using the native git executable. |
this i understand. |
So why don't you answer his question then? In any case, if you still see "git clone" not fail when it should, please file a new issue instead of hooking this one. |
sorry ? between your msg and his link there is what exactly if not my answer ? |
You are not saying what git executable you are using, the one from "<installation path>\bin\git.exe" or "<installation path>\cmd\git.exe". I believe you are using the first one, which is why your issue is not related to issue 43. |
i would check when be at that box. I wonder if i can run directly from BIN - there are some pre-requisites for environment that wrappers did establish (git.cmd is rather complex script). I'm pretty sure that Tortoise used bin\git while from command line i used cmd\git |
It seems to me, that some issues are mixed here. |
Not that I know of. It turns out that 'git clone' simply doesn't check the result of the checkout operation, and never has (see unpack_trees in builtin/clone.c:579). This is not a Git for Windows problem, so please discuss it on the git mailing list. |
I'm glad to see that there's still some discussion about this topic. I personally did invest some effort on fixing this issue (focusing only on getting 'git clean' to work) but that would rather be a change in the msys support layer for which I didn't find yet some good place where to put my automated tests... Question is whether these changes somehow would need to be done in msys/mingw and than merged into git for windows? And where to put any tests? At this moment I'm unsure whether it's really worth the effort - we could just stick to the cygwin implementation of git - while it doesn't look too easy to do changes in msys/mingw. |
This issue by now contains various comments that are not related to the original issue, so I'm closing this in favor of msysgit/msysgit#52 as the long path issue is a Windows / MSYS one, not a core Git one. |
the mentioned link claims "However, git.exe is not an MSYS binary, and does not link to the MSYS-runtime." |
Which is perfectly true as you can easily verify with a tool like Dependency Walker. |
No, DepWalk can detect statically bound dynamically loaded RTLs, but one needs different tools to detect statically compiled RTL (lib, obj) or dynamically bound one (Win32 LoadLibrary call). However that is just nitpicking. The point is that since GIT is not MSYS application, it looks very strange to close this bug just because some other unrelated program (MSYS) also has one. MSYS is MSYS and GIT is GIT. |
If git.exe was an MSYS binary it would link against msys-1.0.dll dynamically, which can be checked with Dependency Walker. No need to play the wise guy by mentioning irrelevant cases where Dependency Walker would not work. That's just not helpful. Also, I think there is no need to lecture us what MSYS is and what not. We got the point that some users would like to see support for long paths, and in order to do so we would need to fix both git.exe and the MSYS tools it relies on. IMHO, a single ticket is enough to track this feature request, and I've chosen msysgit/msysgit#52 instead of this one as it has a clearer comment history and is not spammed by nitpicking / irrelevant comments. |
...what i hate about java developers - is their love for redundant prefixes in every subfolder.
I thought it might be due to TortoiseGIT, yet the console git did me the same.
I thought my T-Git log would remain in clipboard, silly me.
Okay, i was cloning https://github.com/xwiki/xwiki-platform into c:\XWiki.src\xwiki-platform
It downloaded the pack checked delta's and then started checking out.
It then spitted one error that it cannot create file.
It then continued and finally said it is 100% okay.
To me it seems very strange - at elast one error happened, at least one file was not checked out, yet git reports cloning success. Maybe it is right, dunno, but looks strange.
I looked manually and yes, there was some file and some folder missed,
And git.exe could do northing about that.
See http://pastebin.ca/2172286
The problem is those redundant pathnames are crossing 260 length boundary - see http://jsfiddle.net/eaukk/
To access longer pathnames one should use special prefix and Unicode-aware version of function.
See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath
The text was updated successfully, but these errors were encountered: