contribution
contribution copied to clipboard
diff:groovy: can't clone checkstyle repo in some directories on Windows
Identified at https://github.com/checkstyle/contribution/issues/839#issuecomment-1970188522 ,
When running diff.groovy with the checkstyle on my local, I got the following error:
Cloning into 'repositories\checkstyle'...
error: unable to create file src/it/resources/org/checkstyle/suppressionxpathfilter/unnecessarysemicolonafteroutertypedeclaration/SuppressionXpathRegressionUnnecessarySemicolonAfterOuterTypeDeclaration.java: Filename too long
error: unable to create file src/it/resources/org/checkstyle/suppressionxpathfilter/unnecessarysemicolonafteroutertypedeclaration/SuppressionXpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationInnerTypes.java: Filename too long
error: unable to create file src/it/resources/org/checkstyle/suppressionxpathfilter/unnecessarysemicolonaftertypememberdeclaration/SuppressionXpathRegressionUnnecessarySemicolonAfterTypeMemberDeclaration.java: Filename too long
error: unable to create file src/it/resources/org/checkstyle/suppressionxpathfilter/unnecessarysemicolonaftertypememberdeclaration/SuppressionXpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTokens.java: Filename too long
error: unable to create file src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/unnecessarysemicolonafteroutertypedeclaration/InputUnnecessarySemicolonAfterOuterTypeDeclarationRecords.java: Filename too long
error: unable to create file src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/unnecessarysemicolonaftertypememberdeclaration/InputUnnecessarySemicolonAfterTypeMemberDeclarationRecords.java: Filename too long
error: unable to create file src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/variabledeclarationusagedistance/InputVariableDeclarationUsageDistanceCheckSwitchExpressions.java: Filename too long
error: unable to create file src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/variabledeclarationusagedistance/InputVariableDeclarationUsageDistanceCheckSwitchExpressions2.java: Filename too long
error: unable to create file src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/naming/abbreviationaswordinname/InputAbbreviationAsWordInNameCheckEnhancedInstanceofAllowXmlLength1.java: Filename too long
error: unable to create file src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/whitespace/nowhitespacebeforecasedefaultcolon/InputNoWhitespaceBeforeCaseDefaultColonEnumAndStrings.java: Filename too long
error: unable to create file src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/unnecessarysemicolonaftertypememberdeclaration/InputUnnecessarySemicolonAfterTypeMemberDeclarationNullAst.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 with 'git restore --source=HEAD :/'
....
fatal: destination path 'repositories\checkstyle' already exists and is not an empty directory.
fatal: destination path 'repositories\checkstyle' already exists and is not an empty directory.
fatal: destination path 'repositories\checkstyle' already exists and is not an empty directory.
fatal: destination path 'repositories\checkstyle' already exists and is not an empty directory.
Caught: groovy.lang.GroovyRuntimeException: Error: !
This shows I can't do this in a nested directory (M:\checkstyleWorkspaceEclipse\contribution\checkstyle-tester) of 61 characters.
I tested this and I can't clone checkstyle into a path of 71 characters or more.
\contribution\checkstyle-tester\repositories\checkstyle is 56 characters, which doesn't include the drive (2 characters), leaving me 13 characters to put the contribution directory somewhere if I choose.
We should allow users to override the repository directory. It creates issues and a lag to put it into the path of git even with the gitignore when I was working with this on linux.
I think you are cloning main branch if you want take this repo on local system then you need to make a fork and after cloned the repo then from your repo that link you have to clone in local system
Cloning the fork or the main repo has the same effect. This is a windows depth issue and the folders are too deep in the repo.
still it giving the problem ?
Yes.