Repository navigation
Use core.ignorecase to determine case sensitivity - #6212
Conversation
chrisd8088
left a comment
There was a problem hiding this comment.
Thanks again for writing up this PR! I'm sorry it's taken me a while to reply properly.
Your work also prompted me to write up PR #6223, which I've been meaning to do for a while. That PR is still waiting for a review itself, but once that's done and it's merged, I think it will help simplify this PR.
I had a couple of other suggestions as well, and to test them out I drafted some additional commits on top of this PR (after first merging the branch from PR #6223) in my ignorecase branch. Please do take a look and see if those seem reasonable to you. I effectively just added a check for a nil parameter in the new caseFromConfig() function and then renamed some parameters to gitEnv.
Thanks again very much for this PR, which should really improve the experience of Git LFS users with non-default filesystem settings.
|
I'll try to get to rebasing this onto the main branch this week or early next week. |
|
Okay, I think I've got all of your suggestions here, but if I've missed one or more, please let me know and I'll try to get it addressed in a more timely manner than last time. |
chrisd8088
left a comment
There was a problem hiding this comment.
This is looking really good, thank you!
I have only a couple of remaining small suggestions, just to avoid modifying the config and fs packages unnecessarily, and aligning one parameter name with the others.
chrisd8088
left a comment
There was a problem hiding this comment.
I've picked up all those changes, I believe. My apologies for the oversight on the issues you'd mentioned.
No problem at all; thanks for accepting the changes! I'll merge the latest main, let CI finish, and then merge this PR.
Thanks again for this significant improvement to our file path matching!
Right now, we always determine the case sensitivity of the repository based on the operating system default: case insensitive on Windows and macOS and case sensitive on other Unix systems. This works in most cases, but it is possible to have case sensitive file systems on macOS, case sensitive directories on Windows, and case insensitive file systems (e.g., JFS) on Linux, in which case we do not function correctly. Add a function which looks up the `core.ignorecase` variable and if it exists, use it to determine whether we should match case sensitively or insensitively. If it is not set, then assume it is false, since Git only sets it if it needs to be true.
Right now, we always determine the case sensitivity of the repository based on the operating system default: case insensitive on Windows and macOS and case sensitive on other Unix systems. This works in most cases, but it is possible to have case sensitive file systems on macOS, case sensitive directories on Windows, and case insensitive file systems (e.g., JFS) on Linux, in which case we do not function correctly. Use the new function which looks up the `core.ignorecase` variable to determine whether we should match case sensitively or insensitively. Pass the configuration object down to the file path filter so that it can make use of the Git configuration. Add a test for the proper handling of this case based on `core.ignorecase`, which defaults to false. Add a fake environment that we can use throughout the testsuite that contains no actual git configuration data.

Right now, we always determine the case sensitivity of the repository based on the operating system default: case insensitive on Windows and macOS and case sensitive on other Unix systems. This works in most cases, but it is possible to have case sensitive file systems on macOS, case sensitive directories on Windows, and case insensitive file systems (e.g., JFS) on Linux, in which case we do not function correctly.
Add a function which uses the
core.ignorecasesetting in Git to properly detect whether our repository is case sensitive or not.This PR contains independent, logical, bisectable commits each with their own commit message, and as such is best reviewed commit by commit.