-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: Use -z option to git commands to handle unicode file paths #10844
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@hahnlee is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
|
I have already switched to using the -z option (NUL-delimited output) in my workflow. |
### Description In #10844, we introduced support for Unicode characters. This PR adds tests around the behavior. ### Testing Instructions CI <sub>CLOSES TURBO-4980</sub>
Description
Summary
Added the
-zoption to git commands to separate file paths with null bytes (\0) instead of newlines.Why?
When git diff outputs file paths containing Unicode characters (e.g.,
apps/docs/app/테스트.ts), it wraps them in quotes (e.g.,"apps/docs/app/\355\205\214\354\212\244\355\212\270.ts"). This causes issues in theis_file_in_packagefunction, which fails to properly recognize these file paths.Importance
If a filename contains non-ASCII characters (such as CJK), Turbo’s filter logic fails.
This creates friction for developers in non-English locales, including myself.
In particular, turbo-ignore does not trigger correctly, which can break deployments on Vercel.
Solution
Changes made:
-zoption todiff-tree,ls-files, anddiffcommandsadd_files_from_stdoutfunction to process null byte-separated outputTesting Instructions
Reproducing Unicode Filename Diff Format
git diff-tree -r --name-only --no-commit-id HEAD~1 HEAD
git diff-tree -r --name-only --no-commit-id HEAD~2 HEAD
Here filenames are emitted as raw UTF-8 with NUL delimiters (no quotes).
Reproducing the Turbo Failure
turbo run "build" --filter="docs...[HEAD~1]" --dry=json -vv
turbo run "build" --filter="docs...[HEAD~2]" --dry=json -vv
In both cases,
apps/docswas modified.However, in the first case the
docsbuild is not triggered due to quoted path handling.Reproduction after this change