fix: keep non-ASCII paths unescaped in the extracted diff - #93
Open
vitali87 wants to merge 1 commit into
Open
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 30, 2026
vitali87
force-pushed
the
fix/unicode-paths-in-diff
branch
from
August 30, 2026 19:15
055f3d8 to
6be7f0d
Compare
vitali87
force-pushed
the
fix/unicode-paths-in-diff
branch
from
August 30, 2026 19:16
6be7f0d to
5ef542c
Compare
vitali87
force-pushed
the
fix/unicode-paths-in-diff
branch
from
August 30, 2026 19:17
5ef542c to
3ab75d4
Compare
git quotes and octal-escapes non-ASCII paths by default
(core.quotePath). unidiff then fails on new/deleted files ('Target
without source') and, for modified files, records the literal quoted
string as the path so materialization asks git for a path that does
not exist. Run git diff with core.quotePath=false.
vitali87
force-pushed
the
fix/unicode-paths-in-diff
branch
from
August 31, 2026 01:10
3ab75d4 to
5d2f16b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With git's default
core.quotePath=true, any non-ASCII path ingit diffoutput is octal-escaped and quoted:+++ "b/new file \303\274.txt". unidiff cannot parse that for new/deleted files (DiffParseError: Target without source), sopr-split splitaborts with no plan; for modified files it parses but records the literal quoted string as the path, so materialisation later fails withfatal: path '"a/\303\274n\303\257.txt"' does not exist. Found by the end-to-end hunt (ünï.txt,new file ü.txt).Fix
extract_diffrunsgit -c core.quotePath=false diff …. Verified end to end: modified, added, deleted, and nested (dir ü/日本語.txt) non-ASCII paths round-trip through extract → parse → branch creation, and the sub-PR tree is byte-identical todev; also checked underLANG=C.git show,git add --, and the worktree writes all take the raw path fine.Tests
Real-git test with a modified
ünï.txtand an addednew file ü.txt(fails on base); the argv assertion updated.Local review: 5/5. 464 tests pass, ruff clean. Stacked on #70 (stack #81) because it edits the same
git diffinvocation.Follow-up (pre-existing): paths containing
",\, tab or newline are still C-quoted regardless ofcore.quotePath.