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

🐛 incompatibility with case-insensitive filesystems #33

Closed
jeftadlvw opened this issue Jun 4, 2024 · 2 comments
Closed

🐛 incompatibility with case-insensitive filesystems #33

jeftadlvw opened this issue Jun 4, 2024 · 2 comments
Labels
bug::comfirmed Something isn't working severity::high This issue should be prioritized
Milestone

Comments

@jeftadlvw
Copy link
Owner

jeftadlvw commented Jun 4, 2024

See attached image. When cd'ing into a directory so that the working directory is technically the same but the actual path is different, git-nest does some really weird things. It chooses the current working directory as the root (which is technically correct and the same), but chooses the correct path as the repository root and thus says that the current working directory is not a git repository.

Maybe lowecasing paths at comparisons could be enough. I think it's because Windows and MacOS filesystems are case-insensitive by default (which is much preferred, MacOS supports both). Ext-4 on the other hand is case sensitive.

This problem should be taken in consideration when comparing paths. Golang offers a function that checks wether the underlying filesystem is case-sensitive or not: https://pkg.go.dev/github.com/golang/dep/internal/fs#IsCaseSensitiveFilesystem. However, this function performs some system calls, which might lead to performance impacts on larger scale.

I propose a function for comparing paths, which should be the new default way of comparing paths:

func (p Path) Equals(other Path) bool {
   // check for case sensitivity
   // if case insensitive, then lowecase and compare
   // else compare directly
}

screenshot

@jeftadlvw jeftadlvw added bug::comfirmed Something isn't working severity::high This issue should be prioritized labels Jun 4, 2024
@jeftadlvw jeftadlvw added this to the v0.0.2 milestone Jun 4, 2024
@jeftadlvw
Copy link
Owner Author

This problem should be fixed with 6e46d9c and 6c184cf, closing for now.

@jeftadlvw
Copy link
Owner Author

This bug report also caused #34 to be opened, an improvement proposal for the path utility model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug::comfirmed Something isn't working severity::high This issue should be prioritized
Projects
None yet
Development

No branches or pull requests

1 participant