Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[Linux] Support case-sensitive filesystems #1412
Conversation
|
/azp run GitHub VFSForGit Mac Functional Tests |
|
No pipelines are associated with this pull request. |
|
/azp run GitHub VFSForGit Mac Functional Tests |
|
No pipelines are associated with this pull request. |
|
LGTM, but please let @kewillford or @wilbaker give their thoughts on the SQL changes before merging. |
|
Just to expand on our conversation today, I hope to add some further refinements in the non-common, platform-specific code (e.g., |
26ef76b
to
fa6915c
|
Looks like the sparse mode changes have added a single new test failure ... will investigate today. |
|
/azp run PR - Windows - Functional Tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run PR - Windows - Functional Tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
On Linux, file paths are case-sensitive, so we always use lowercase paths generated from SHA1 values because that ensures consistency with Git's own naming scheme for files under .git/objects.
Make sure to use the exact case-sensitive name of FastFetch.dll in the test suite.
Simplify a few more platform-specific case-sensitivity checks in the functional tests and CmdRunner by using FileSystemHelpers, as suggested by kewillford on PR review.
Per PR suggestion from kewillford.
Per PR suggestion from kewillford.
Per PR suggestion from wilbaker, we hoist the check on whether to perform a case-sensitive string comparison or not out of the core loop of the LazyUTF8String.Compare() method in GitIndexProjection. This should reduce the number of additional conditional tests to just one per Compare() invocation, as opposed to one per compared byte. (We could, if need be, further reduce the overhead by creating two independent Compare() methods and not passing in a bool flag, and then hoisting the comparsion-mode check higher in SortedFolderEntries.GetSortedEntriesIndexOfName() so that different versions of that method were executed depending on the mode. However, we reserve this option for now, depending on the results of performance tests.) We also add labels to the bool flags used in some of the helper methods used by the unit tests, per PR advice.
Per PR advice from wilbaker.
As wilbaker noted in PR review, we really don't need the Case[In]SensitiveFileSystem functional test categories because we've now created the public boolean flag in FileSystemHelpers, so we can just toggle case-sensitive behaviour on that flag instead of duplicating tests and moving code around. Nice catch!
|
Approving now, but please make the final minor functional tests changes discussed in the comments before merging. |
4736473
into
microsoft:master
|
As we discussed, @wilbaker, I'll put the minor functional test changes into a small followup PR. Thanks for all the help!! |
On case-insensitive filesystems, we can restore the use of non-case-matching mixed-case file and folder paths in several PrefetchVerbTests, while retaining case-sensitive exact matches on Linux. These changes are a follow-up based on PR feedback from wilbaker on PR microsoft#1412 and commit 5c78902.
Add initial Linux platform and scripts This is an initial port of the GVFS.Platform.Linux classes and the Scripts/Linux scripts from both the Mac equivalents in this repository as well as the corresponding classes in the VFSForGit repository. Note that some useful refactoring which exists in the VFSForGit features/linuxprototype branch, such as microsoft/VFSForGit@7b70850, has not yet been ported; this would eliminate some of the duplication between the Mac and Linux platforms and move common code into the POSIX one. This PR also does not yet include the case-sensitive filename support in VFSForGit's master branch from microsoft/VFSForGit#1412. Quoting from the primary VFSForGit commit microsoft/VFSForGit@b304cf7 from which this work was derived: We add the core GVFS.Platform.Linux classes, derived from their GVFS.Platform.Mac equivalents but with appropriate changes for syscall argument signatures and flag values, type definitions, and structure fields (e.g., mode_t is a uint, and the layout of struct stat is quite different).
TODO -- see VFSForGit#1503 and #1412 for more work to be refactored. 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#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>
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>
This PR looks to resolve a number of case-sensitivity issues with the current provider code and test suite, including:
FastFetch.dllnotfastfetch.dll. This includes references to Git object files, for which the SHA1 value needs to be lowercased.DiffHelperfunctions correctly on case-sensitive filesystems; among other things, this allowsFastFetchto succeed.GitCommandsTests.CaseOnlyRenameFileAndChangeBranches()functional test succeeds.The latter's failure on a case-sensitive filesystem is due to case-insensitivity in the current modified paths database and virtualization code, among other things, which results in case-differing-only filenames being dropped from the data sent back from the GVFS provider, via the
virtual-filesystemhook, to Git itself after it reads itsindexfile.Introduce case-sensitive file path matching and sorting of file and folder names within the repository as well as the modified paths and placeholder list databases, but only on Linux and other case-sensitive file systems, while retaining existing case-insensitive behaviour on Windows
and Mac platforms.
Use filesystem-specific case matching when comparing path throughout the functional test suite.
Also make sure to exclude the case-sensitive filesystem unit tests when running on Windows or Mac platforms.
Also fix the path matching in the
HydrateEntireRepo()helper forMultiEnlistmentTests.SharedCacheTests, which was not excluding{repoRoot}/.git/paths on Mac (or Linux) due to hard-coded Windows path separators.Divide the
HydratingFileUsesNameCaseFromRepo()andHydratingNestedFileUsesNameCaseFromRepo()functional testsinto pairs, one for case-sensitive filesystems, and one for case-insensitive filesystems.
Includes some filename case corrections to prevent test case regressions on case-sensitive filesystems, use of lowercase paths generated from SHA1 values because that ensures consistency with Git's own naming scheme for files under
.git/objectson case-sensitive filesystems, and fixes for some hard-coded uses of Windows path separators.Resolves github#29.
/cc @jrbriggs, @kivikakk.