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

[Bug]: Unsupported filenames causes problems on Android #837

Open
unlair opened this issue Jan 14, 2025 · 2 comments
Open

[Bug]: Unsupported filenames causes problems on Android #837

unlair opened this issue Jan 14, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@unlair
Copy link

unlair commented Jan 14, 2025

Describe the bug

If you sync files with filenames that contain unsupported characters (e.g., "*/:<>?\|, most of which are valid in Linux) in the Android filesystem, they will become staged for delete. It might be helpful to display a warning about that and leave the files as unstaged deletions.

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

No response

Steps to reproduce

  • On a PC, commit a file with a filename that includes one of the following characters: "*/:<>?\|
  • On Android, do Git: Pull from Obsidian

Expected Behavior

Warning appears and suggests renaming affected files.

Addition context

No response

Operating system

Android

Installation Method

None

Plugin version

2.30.1

@unlair unlair added the bug Something isn't working label Jan 14, 2025
@xenoxriar
Copy link

While it might be good for a warning to appear about invalid filenames on Android, if it's not possible, the app should recommend users simply just avoid using those filenames altogether. Might be good to explore disabling the core.protectNTFS git flag and also adding those files to the .git/info/exclude file. That would unfortunately mean you can't access or edit those files but it would keep them safe from accidental deletion.

@unlair
Copy link
Author

unlair commented Feb 6, 2025

Enabling core.protectNTFS is a fantastic idea! I didn't know that flag existed, and it looks like the NTFS set of prohibited characters is the same as the Android one. Thanks a lot!

Edit: I tried using core.protectNTFS, but that still lets me create and commit files and directories with invalid characters. It seems that it will only do something when you're cloning a repo/checking out a branch from a Windows machine (could be wrong).

The .git/info/exclude & warning route is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants