fix: Windows snapshot fails with non-ASCII filenames (Chinese, Japanese, etc.)#9844
fix: Windows snapshot fails with non-ASCII filenames (Chinese, Japanese, etc.)#9844yimingll wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: PR #9408: test(snapshot): add extended test cases for revert functionality This PR is related as it addresses snapshot and revert functionality testing, which is directly relevant to the snapshot/revert issues being fixed in PR #9844. However, this appears to be a test PR rather than a fix for the same issue, so it's more of a complementary PR than a true duplicate. No duplicate PRs found addressing the same Windows non-ASCII filename snapshot issue. |
On Windows, Bun's $ template literal incorrectly handles variable interpolation, replacing variables with placeholders like ?__bunstr_0 instead of actual values. This causes: - git add . to silently fail adding non-ASCII filenames to snapshot - git checkout / git ls-tree to fail finding files during revert - Undo command only reverts conversation but not code changes Solution: Replace all $ template calls with Bun.spawn() which correctly passes arguments as an array, bypassing shell interpolation issues. Also adds unquote() function to decode git's octal-escaped non-ASCII filenames in diff output (when core.quotepath=true, which is the default). Tested on Windows 11 with Chinese filenames - undo now correctly reverts files. Fixes anomalyco#10210
befcb08 to
8d4ccf4
Compare
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Summary
Fix undo/revert not working on Windows when project contains non-ASCII filenames (e.g., Chinese, Japanese, Korean characters).
Problem
On Windows, Bun's
$template literal incorrectly handles variable interpolation, replacing variables with placeholders like?__bunstr_0instead of actual values. This causes:git add .to silently fail adding non-ASCII filenames to snapshotgit checkout/git ls-treeto fail finding files during revertSolution
Replace all
$template calls withBun.spawn()which correctly passes arguments as an array, bypassing shell interpolation issues.Also adds
unquote()function to decode git octal-escaped non-ASCII filenames in diff output (whencore.quotepath=true, which is the default).Testing
Tested on Windows 11 with Chinese filenames (e.g.,
公共函数.cpp) - undo now correctly reverts files.Fixes #10210