msysgit / git

msysGit-based Git for Windows 1.x is now superseded by Git for Windows 2.x
http://github.com/git-for-windows/git
Other
1.01k stars 316 forks source link

Filename too long #288

Closed maybeec closed 9 years ago

maybeec commented 9 years ago

I am currently using 1.9.4.msysgit.2 and getting the following exception when adding a file to source control using msysgit:

fatal: unable to stat 'product/product-core/src/test/resources/testdata/api/TemplateScanTest/templates/testTemplates/${variables.rootPackage}/Test${variables.component#upper_case}/${variables.component#cap_first#replace('1','ONE')}.java.ftl': Filename too long

Do not ask for the need of the special signs within the file path :) As far as I have read older issues, there were issues, which already covered filename length. So maybe this is also an issue of some of the special signs?

maybeec commented 9 years ago

It seems to be the filename. I removed all special signs from the path. The relative file path has the length 217. The absolute file path on the file system is of length 283.

t-b commented 9 years ago

You can have a try with optional long path support, see https://github.com/msysgit/msysgit/wiki/Git-cannot-create-a-filedirectory-with-a-long-path.

maybeec commented 9 years ago

any risks or why to state this as optional and have not integrated this yet?

kblees commented 9 years ago

from the commit message:

While improved error checking is always active, long paths support must be explicitly enabled via 'core.longpaths' option. This is to prevent end users to shoot themselves in the foot by checking out files that Windows Explorer, cmd/bash or their favorite IDE cannot handle.

maybeec commented 9 years ago

ok thanks :) nice comment. Again a case, where windows drawbacks affects also other tooling.