spring-attic / scriptable-transform

Apache License 2.0
0 stars 8 forks source link

Windows : long filenames causes problems at git checkout #12

Closed marcpa00 closed 5 years ago

marcpa00 commented 5 years ago

Files under folder spring-cloud-starter-stream-processor-scriptable-transform ends up being longer than the limit on windows, causing problems with the git checkout on such platforms :

mpaquett@L00112 MINGW64 /C/Code/spring-data-flow-getting-started/spring-cloud-stream-app-starters                                                                                                                                                                               $ git clone https://github.com/spring-cloud-stream-app-starters/scriptable-transform.git                                                                                                                                                                                       
Cloning into 'scriptable-transform'...                                                                                                                                                                                                                                         
remote: Enumerating objects: 78, done.                                                                                                                                                                                                                                         
remote: Counting objects: 100% (78/78), done.                                                                                                                                                                                                                                  
remote: Compressing objects: 100% (39/39), done.                                                                                                                                                                                                                               
remote: Total 519 (delta 31), reused 62 (delta 19), pack-reused 441                                                                                                                                                                                                            
Receiving objects: 100% (519/519), 107.23 KiB \| 4.66 MiB/s, done.                                                                                                                                                                                                              
Resolving deltas: 100% (217/217), done.                                                                                                                                                                                                                                        
error: unable to create file spring-cloud-starter-stream-processor-scriptable-transform/src/main/java/org/springframework/cloud/stream/app/scriptable/transform/processor/ScriptVariableGeneratorConfiguration.java: Filename too long
error: unable to create file spring-cloud-starter-stream-processor-scriptable-transform/src/main/java/org/springframework/cloud/stream/app/scriptable/transform/processor/ScriptableTransformProcessorConfiguration.java: Filename too long
error: unable to create file spring-cloud-starter-stream-processor-scriptable-transform/src/main/java/org/springframework/cloud/stream/app/scriptable/transform/processor/ScriptableTransformProcessorProperties.java: Filename too long
error: unable to create file spring-cloud-starter-stream-processor-scriptable-transform/src/test/java/org/springframework/cloud/stream/app/scriptable/transform/processor/ScriptableTransformProcessorIntegrationTests.java: Filename too long
fatal: unable to checkout working tree                                                                                                                                                                                                                                         
warning: Clone succeeded, but checkout failed.                                                                                                                                                                                                                                 
You can inspect what was checked out with 'git status'                                                                                                                                                                                                                         
and retry the checkout with 'git checkout -f HEAD'

Article https://ourcodeworld.com/articles/read/109/how-to-solve-filename-too-long-error-in-git-powershell-and-github-application-for-windows describes the problem and a possible solution:

git config --system core.longpaths true

which worked for me.

Maybe this information should be added to the README.adoc ?

artembilan commented 5 years ago

Feel free to contribute such a NOTE into the README.adoc under the build section. Although it is general Git issue, so doesn't sound like related to this project...

Thanks

marcpa00 commented 5 years ago

Since it happens at git clone time, it is not a build problem but a "getting the source code" problem. Agreed it is a general git issue, but scriptable-transform do have long filenames and thus triggers that problem (as will any other project with long filenames).

What I want to say is : the notice about this git attribure for long paths would be better placed close to the place and time where a contributor decides to get the source code from github. Maybe it could be placed in the README.adoc of every app-starter project having long filenames (would have to find this with a script or manually) and also in the introduction text at top of starter page https://github.com/spring-cloud-stream-app-starters ?

I will contribute a note for the former, but I'm not sure on how to do the latter.

marcpa00 commented 5 years ago

PR #14

artembilan commented 5 years ago

Closed with: https://github.com/spring-cloud-stream-app-starters/scriptable-transform/commit/4b425577e9734bfc840cc5e9cb8c7d43a919a584