Skip to content
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

🐛 Changes in files with non-Latin names incorrectly imply these files being renamed #1821

Closed
koterpillar opened this issue Aug 22, 2024 · 1 comment · Fixed by #1840
Closed

Comments

@koterpillar
Copy link

When the name of a changed file contains non-Latin characters, delta shows it as renamed instead of just the contents being changed.

To reproduce:

$ git init
$ echo one > привет.txt; echo three > hello.txt
$ git add .
$ echo two > привет.txt; echo four > hello.txt
$ git diff

Delta output:

image

Note the headers for the two files:

...
hello.txt
...
a/\320\277\321\200\320\270\320\262\320\265\321\202.txt ⟶   b/\320\277\321\200\320\270\320\262\320\265\321\202.txt
...

Raw git diff output:

$ git --no-pager diff
diff --git a/hello.txt b/hello.txt
index 2bdf67a..8510665 100644
--- a/hello.txt
+++ b/hello.txt
@@ -1 +1 @@
-three
+four
diff --git "a/\320\277\321\200\320\270\320\262\320\265\321\202.txt" "b/\320\277\321\200\320\270\320\262\320\265\321\202.txt"
index 5626abf..f719efd 100644
--- "a/\320\277\321\200\320\270\320\262\320\265\321\202.txt"
+++ "b/\320\277\321\200\320\270\320\262\320\265\321\202.txt"
@@ -1 +1 @@
-one
+two
@th1000s
Copy link
Collaborator

th1000s commented Sep 2, 2024

Thanks, should be fixed now.

You can also set git config [--global] core.quotepath false so git (and delta) prints the filenames as-is (assuming the terminal supports Unicode/UTF-8, but most do).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants