jellyedwards / gitsweep

VS Code extension to allow changes files to be excluded from git (--skip-worktree, --assume-unchanged, exclude file)
19 stars 1 forks source link

Files with filenames containing non-ASCII characters are not displayed correctly in Gitsweep panel #20

Open Amanoki opened 7 months ago

Amanoki commented 7 months ago

Hi, I recently found this useful extension. Thanks for it and hope you're doing well!

I would like to report an issue: The Gitsweep panel is not correctly handling files when filenames contain non-ASCII characters (e.g. Chinese, Japanese).

gitsweep1

As shown in the screenshot, both files belong to the same TestFolder folder while the second file contains non-ASCII characters. Both files are correctly applied Skip Worktree, however:

  1. the Gitsweep panel puts the second file in a fake "TestFolder folder;
  2. the filename of the second file is not displayed correctly;
  3. the Retore action and the clicking and opening the file in the editor feature will not work for the second file.

This is probably due to the fact that when the filename contains non-ASCII characters, its path is wrapped in quotation marks and the extension doesn't handle it correctly. This is how their path look in the terminal: gitsweep2

Expected behavior: Both files should be put in the same folder, the filenames with non-ASCII characters should be correctly displayed and all available actions should work for it correctly.

Hopefully this issue can be fixed, thank you!

jellyedwards commented 6 months ago

Hey, glad you like it! I'll look at this as soon as I can, really busy with work at the moment so it might be a while! Thanks for your patience!

Amanoki commented 6 months ago

Thank you for the reply! I actually solved it by setting git config --global core.quotepath false. It made the terminal display the correct characters and the extension panel displays normally as well, so it's working fine for me now. Although there might be a way to make the extension display normally even without this setting. Feel free to look into it only when you have time!

jellyedwards commented 6 months ago

Oh cool, great you found a solution! I'll definitely revisit when I get the time and see what I can do.