-
Notifications
You must be signed in to change notification settings - Fork 64
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
File Name Too Long Error On Windows PowerShell 7 #853
Comments
Hi @alexAtSourcegraph ! I had the same issue as you using Git for Windows and Git bash in Windows 10: manios@LAPTOP-WIN10 MINGW64 /c/goprojects/src-cli/cmd/src (main)
$ ./src.exe batch preview -f ../../deleteean.yml
✅ Parsing batch spec
✅ Resolving namespace
✅ Preparing container images ███████████████████ 100%✅ Set workspace type
✅ Resolved 1 workspaces from 1 repositories
✅ Found 0 cached changeset specs; 1 task needs to be executed
✅ Executing... (1/1, 1 errored) ███████ 100%│
└── gitlab.internal.manios.local/maniosorg/myprojects/jetfirestarter creating workspace: preparing local git repo: git add failed: 'git add --force --all' failed: warning: could not open directory 'src/test/java/org/manios/jfs/service/impl... 0s
❌ Error:
gitlab.internal.manios.local/maniosorg/myprojects/jetfirestarter:
creating workspace: preparing local git repo: git add failed: 'git add --force --all' failed: warning: could not open directory 'src/test/java/org/manios/jfs/service/impl': Filename too long
fatal: unable to stat 'src/main/java/org/manios/jfs/service/impl/FirestarterImpl.java': Filename too long: exit status 128
Log: C:\Users\manios\AppData\Local\Temp\changeset-gitlab.internal.manios.local.maniosorg.jetfirestarter-01c9cda30fb8dcd2701303efc5d2e6e65218d952.2041328270.log The problem is that The only way to make it work is to patch locally the diff --git a/internal/batches/workspace/git.go b/internal/batches/workspace/git.go
index 20c20d1..ef409b2 100644
--- a/internal/batches/workspace/git.go
+++ b/internal/batches/workspace/git.go
@@ -12,9 +12,9 @@ func runGitCmd(ctx context.Context, dir string, args ...string) ([]byte, error)
cmd := exec.CommandContext(ctx, "git", args...)
cmd.Env = []string{
// Don't use the system wide git config.
- "GIT_CONFIG_NOSYSTEM=1",
+ // "GIT_CONFIG_NOSYSTEM=1",
// And also not any other, because they can mess up output, change defaults, .. which can do unexpected things.
- "GIT_CONFIG=/dev/null",
+ // "GIT_CONFIG=/dev/null",
// Don't ask interactively for credentials.
"GIT_TERMINAL_PROMPT=0",
// Set user.name and user.email in the local repository. The user name and Then, if you compile it locally and run it, it works. I could not find any other straightforward solution at the moment. Best regards, |
Also seen at https://github.com/sourcegraph/accounts/issues/8873 |
fatal: unable to stat ‘path/to/files’ Filename too long: exit status 128
error when repos have long names.Effort tried to rectify issue:
The text was updated successfully, but these errors were encountered: