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

Long filenames in cyrillic(russian) don't recognize. #2820

Open
1 task done
blackmore466 opened this issue Sep 17, 2020 · 10 comments
Open
1 task done

Long filenames in cyrillic(russian) don't recognize. #2820

blackmore466 opened this issue Sep 17, 2020 · 10 comments

Comments

@blackmore466
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

Git version: 2.28.0.windows.1
Windows 10 Pro

$ git config --global core.longpaths
true

Details

I have git repo with 4 files. One of them has long cyrillic name.
image

Git Bash doesn't process it.
image

@dscho
Copy link
Member

dscho commented Sep 17, 2020

My gut feeling tells me that the root cause is msys2/MSYS2-packages#1974. Could you run cmd //c chcp 65001 and try again?

@blackmore466
Copy link
Author

It repaired unreadable symbols. But problem with long names is still here

image

@dscho
Copy link
Member

dscho commented Sep 17, 2020

But problem with long names is still here

You mean the ls-la problem?

@blackmore466
Copy link
Author

Yes. And git add * or git rm

@dscho
Copy link
Member

dscho commented Sep 24, 2020

Could you re-test with the latest snapshot, please?

@blackmore466
Copy link
Author

blackmore466 commented Sep 24, 2020

This snapshot didn't solve the problem.
But I found workaround solution: if I use git add/git rm with double-quotes it works
image

Problem with ls still remained. But it's not so important now.
Issue can be closed. Thanks!

@dscho
Copy link
Member

dscho commented Sep 24, 2020

But I found workaround solution: if I use git add/git rm with double-quotes it works

Oh, that's a good find! In the unquoted version, it is Bash's job to expand the wildcard, in the quoted version, it is Git's job (I think). So the remaining problem lies with Bash, apparently...

@dscho
Copy link
Member

dscho commented Mar 28, 2022

@blackmore466 did you have a chance to look into this more deeply?

@blackmore466
Copy link
Author

So the remaining problem lies with Bash, apparently...

Yes, it's Linux limitation for filename length
https://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits

Git is just victim :)

@rimrul
Copy link
Member

rimrul commented Mar 29, 2022

The specific limitation seems to be the length of d_name in struct dirent. This should stay limited to NAME_MAX + 1, so a fix could be to increase NAME_MAX.

Assuming that Wikipedia page is correct and I'm reading it correctly the NTFS limit is 255 UTF-16 code points (2 bytes each), so increasing NAME_MAX to 510 should do the trick. I have no clue what downsides and side-effects that could have, though.

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

No branches or pull requests

3 participants