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

git integration cannot work when the filepath inclues combining character on Mac OS #123108

Closed
yumetodo opened this issue May 6, 2021 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues

Comments

@yumetodo
Copy link

yumetodo commented May 6, 2021

  • VS Code Version: 1.56.0 (Universal)
  • OS Version: Mac OS X 10.15.7 19H2
  • git version: 2.31.1 via homebrew
    Steps to Reproduce:
  1. create directory named with ポ("\u30DB\u309A")
  2. create git repo with git init command
  3. open the directory with vscode
  4. create some file
  5. stage the file using vscode
    image
  6. you can see Git: fatal: /Users/<name>/ポ/foo.txt: '/Users/<name>/ポ/foo.txt' is outside repository

Does this issue occur when all extensions are disabled?: Yes

@yumetodo
Copy link
Author

yumetodo commented May 6, 2021

On Windows10 2004(19041.928), no problem.

Investigate steps:

  1. create C++ program like below, compile with msvc(_MSC_FULL_VER: 192829913, /std:c++17)

    #include <filesystem>
    #include <iostream>
    #include <iomanip>
    namespace fs = std::filesystem;
    int main()
    {
        fs::create_directories(U"test\\\u30DB\u309A");
        for (const fs::directory_entry& x : fs::directory_iterator("test")) {
            const auto p = x.path().u32string();
            if (const auto pos = p.find(U"\u30DB\u309A"); std::u32string::npos != pos) {
                std::cout << "found" << std::endl;
            }
            std::cout << p.length() << std::endl;
            bool flg = false;
            for (auto&& c : p) {
                if (std::exchange(flg, true)) std::cout << ", ";
                std::cout << std::hex << c;
            }
            std::cout << std::endl;
        }
    }
  2. check the output. my output is below so that the directory was created correctly that includes combining characters.

    found
    7
    74, 65, 73, 74, 5c, 30db, 309a
    
  3. In the directory, follow steps showing first post, no problem.

@yumetodo
Copy link
Author

yumetodo commented May 6, 2021

@yoshi389111 says, Ubuntu on WSL on Windows + VSCode(Remote develop) env, no problem.

https://qiitadon.com/@yoshi389111/106188133990173313

LinuxのGUIは持っていないので、単なるにぎやかしですが

Windows + WSL(Ubuntu) で、vscode のリモート接続でも、結合文字の"ポ"のディレクトリで、ステージングはできますね。

確認済なのかもしれませんけど

https://qiitadon.com/@yoshi389111/106188154344176104

一応、こーゆーことですよね?
img

@manzyun
Copy link

manzyun commented May 6, 2021

IMHO

Summary

I can't reproduce this issue 😢

However, I ran VSCode on Flatpak and installed Flathub repository... This repository is not unofficial.

And, Git version is 2.30.2 .

So, my reproduce is not perfect 🙇🏼

My Environments

VSCode's About
Version: 1.56.0
Commit: cfa2e218100323074ac1948c885448fdf4de2a7f
Date: 2021-05-04T21:58:14.757Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Linux x64 5.11.0-18.1-liquorix-amd64
Any Environment
$ git --version
git version 2.30.2

$ flatpak --version
Flatpak 1.11.1

Suggestion to @yumetodo

My environment git output log in VSCode at near git add:

> git ls-files --stage -- /home/<name>/ポ/poyo.py
git.stage 1
git.stage.scmResources 1
> git add -A -- /home/<name>/ポ/poyo.py
> git status -z -u

I hope this helps you if you check your logs.

@yumetodo
Copy link
Author

yumetodo commented May 6, 2021

According to these investigations, we can sey that this issue occurs only on mac.

@yumetodo yumetodo changed the title git integration cannot work when the filepath inclues combining character git integration cannot work when the filepath inclues combining character on Mac OS May 6, 2021
@yumetodo
Copy link
Author

yumetodo commented May 7, 2021

It might be related with #41246...

@lramos15 lramos15 assigned lszomoru and unassigned eamodio Oct 11, 2021
@lszomoru lszomoru added bug Issue identified by VS Code Team member as probable bug git GIT issues labels Oct 25, 2021
@lszomoru
Copy link
Member

Closing this as duplicate of #41246

@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Projects
None yet
Development

No branches or pull requests

4 participants