Perform case-sensitive path comparisons on Linux#1232
Perform case-sensitive path comparisons on Linux#1232kivikakk merged 1 commit intomicrosoft:features/linuxprototypefrom
Conversation
|
/azp run GitHub VFSForGit Mac Functional Tests |
|
No pipelines are associated with this pull request. |
|
I thought I'd give it a try! Looks like maybe I don't have permissions? |
It looks like the mac build worked for you. Sorry that you don't have access to the build results themselves. It's unfortunate that we always get those "No pipelines are associated..." messages. |
derrickstolee
left a comment
There was a problem hiding this comment.
This seems straight-forward. I just have one question about how we can skip tests more eloquently using annotations, but I don't know if it is possible. Thanks!
| [TestCase] | ||
| public void ParsesCaseChangesAsAdds() | ||
| { | ||
| if (GVFSPlatform.Instance.Constants.CaseSensitiveFileSystem) |
There was a problem hiding this comment.
I wonder if there is a way to do this with test categories using the [] annotations.
| @@ -260,7 +260,7 @@ public void WriteAllEntriesAndFlush(IEnumerable<IPlaceholderData> updatedPlaceho | |||
|
|
|||
| private IEnumerable<string> GenerateDataLines(IEnumerable<IPlaceholderData> updatedPlaceholders) | |||
There was a problem hiding this comment.
FYI - On master the placeholders are now being stored in a SQLite database (see #1140). When updating the Linux feature branch to pick up that change you'll need to make the table creation call aware of whether the platform is case sensitive (currently the table is created with a case-insensitive path/key).
|
FYI - If you need to support repos that have files whose names only differ by case, you'll also need to update It uses Please note that this is an extremely hot path, and has been tuned to eliminate as many instructions as possible (it's hit for every entry when parsing the index) and so we'll have to be careful with how this code is updated. Related, there is a project |
Sounds like we will need a new set of functional tests that only run on Linux that check case-sensitive comparisons by explicitly adding files or folders that differ only by case, otherwise, we will never know if we've checked all the things we need to make this switch. |
b570b92 to
105c1f5
Compare
|
For now we've decided to not support in-tree files whose name only differ by case -- this PR will be scoped only to the operations VFS for Git performs on the filesystem for its own functioning (like locating the |
105c1f5 to
33369e0
Compare
This only applies to on-disk operations like locating the ".git" directory or ".idx" files, etc. -- the repository contents remain case-insensitive.
33369e0 to
c2a89da
Compare
|
I think this should be good to go -- @derrickstolee @wilbaker fyi in case you'd like to re-review. I've lessened the scope of the change so nothing that impacts tracked content should be changed now. |
|
The paths referred to in those instances are in-tree paths (tracked content), and so are not in the scope of the change proposed in this PR. We'll only change those if we proceed to make VFSForGit support case-sensitivity in the repository contents. Right now we're just behaving appropriately with respect to the backing store. |
TODO -- since we have no failing tests without this work, add some. Use filesystem-specific case matching when comparing path throughout Scalar and the functional test suite. From microsoft/VFSForGit#1232, microsoft/VFSForGit#1412, and microsoft/VFSForGit#1503. From microsoft/VFSForGit@e6eb054, microsoft/VFSForGit@66e3e21, microsoft/VFSForGit@6067f04, and microsoft/VFSForGit@7100179. Co-authored-by: Ashe Connor <ashe@kivikakk.ee>
TODO -- since we have no failing tests without this work, add some. Use filesystem-specific case matching when comparing path throughout Scalar and the functional test suite. From microsoft/VFSForGit#1232, microsoft/VFSForGit#1412, and microsoft/VFSForGit#1503. From microsoft/VFSForGit@e6eb054, microsoft/VFSForGit@66e3e21, microsoft/VFSForGit@6067f04, and microsoft/VFSForGit@7100179. Co-authored-by: Ashe Connor <ashe@kivikakk.ee>
TODO -- since we have no failing tests without this work, add some. Use filesystem-specific case matching when comparing path throughout Scalar and the functional test suite. From microsoft/VFSForGit#1232, microsoft/VFSForGit#1412, and microsoft/VFSForGit#1503. From microsoft/VFSForGit@e6eb054, microsoft/VFSForGit@66e3e21, microsoft/VFSForGit@6067f04, and microsoft/VFSForGit@7100179. Co-authored-by: Ashe Connor <ashe@kivikakk.ee>
TODO -- since we have no failing tests without this work, add some. Use filesystem-specific case matching when comparing path throughout Scalar and the functional test suite. From microsoft/VFSForGit#1232, microsoft/VFSForGit#1412, and microsoft/VFSForGit#1503. From microsoft/VFSForGit@e6eb054, microsoft/VFSForGit@66e3e21, microsoft/VFSForGit@6067f04, and microsoft/VFSForGit@7100179. Co-authored-by: Ashe Connor <ashe@kivikakk.ee>
TODO -- since we have no failing tests without this work, add some. Use filesystem-specific case matching when comparing path throughout Scalar and the functional test suite. From microsoft/VFSForGit#1232, microsoft/VFSForGit#1412, and microsoft/VFSForGit#1503. From microsoft/VFSForGit@e6eb054, microsoft/VFSForGit@66e3e21, microsoft/VFSForGit@6067f04, and microsoft/VFSForGit@7100179. Co-authored-by: Ashe Connor <ashe@kivikakk.ee>
Use filesystem-specific case matching when comparing path throughout Scalar and the functional test suite. From microsoft/VFSForGit#1232, microsoft/VFSForGit#1412, and microsoft/VFSForGit#1503. From microsoft/VFSForGit@e6eb054, microsoft/VFSForGit@66e3e21, microsoft/VFSForGit@6067f04, and microsoft/VFSForGit@7100179. Co-authored-by: Ashe Connor <ashe@kivikakk.ee>
On Windows and Mac, path comparisons are case-insensitive, as the filesystems are case-insensitive --
.gitand.GITare the same path name, and you can't have two different files or directories with names that only differ in case.On Linux, filesystems (usually) are case-sensitive -- it is possible to have
.git,.GITand.Gitentries in the one directory, all referring to different things. Accordingly, we need to do all path comparisons in a case-sensitive fashion.This change should be a no-op for Windows and Mac, inasmuch as no different values will result after the change. This change does mean
GVFSPlatform.Instanceis being relied on in more places, and it's difficult to audit if a given piece of code could be called withoutGVFSPlatform.Instancealready being initialised. (This bit me when working on #1084, where I tried to useGVFSPlatform.InstanceinGVFS.FunctionalTests.LockHolder, which silently died with NRE because it wasn't initialised.)Nonetheless, unit and (Windows) functional tests pass, so it might be fine.
Fixes github#29.
/cc @chrisd8088