Permalink
Browse files

Reliability update:

- Improved handling of IO timeouts
- Made it easier to discover and configure cache servers
- Improved reliability of GVFS.Service
- More repair options
- Many other perf and bug fixes
  • Loading branch information...
sanoursa committed Aug 17, 2017
1 parent 522d018 commit 153006d8a961d85d098090cc3634ac33ff72896d
Showing with 7,397 additions and 4,129 deletions.
  1. +6 −1 GVFS.sln
  2. +47 −21 GVFS/FastFetch/CheckoutFetchHelper.cs
  3. +2 −2 GVFS/FastFetch/FastFetch.csproj
  4. +25 −13 GVFS/FastFetch/FastFetchVerb.cs
  5. +72 −18 GVFS/FastFetch/FetchHelper.cs
  6. +1 −1 GVFS/{GVFS.Common/Physical → FastFetch}/Git/BigEndianReader.cs
  7. +25 −4 GVFS/FastFetch/Git/DiffHelper.cs
  8. +48 −0 GVFS/FastFetch/Git/EndianHelper.cs
  9. +89 −17 GVFS/FastFetch/Git/GitIndexGenerator.cs
  10. +1 −2 GVFS/FastFetch/Git/GitPackIndex.cs
  11. +0 −41 GVFS/FastFetch/Git/RefSpecHelpers.cs
  12. +0 −55 GVFS/FastFetch/Git/UpdateRefsHelper.cs
  13. +5 −14 GVFS/FastFetch/GitEnlistment.cs
  14. +188 −197 GVFS/FastFetch/Index.cs
  15. +2 −1 GVFS/FastFetch/Jobs/BatchObjectDownloadJob.cs
  16. +1 −1 GVFS/FastFetch/Jobs/CheckoutJob.cs
  17. +11 −8 GVFS/FastFetch/Jobs/FindMissingBlobsJob.cs
  18. +1 −1 GVFS/GVFS.Common/AntiVirusExclusions.cs
  19. +1 −2 GVFS/GVFS.Common/ConcurrentHashSet.cs
  20. +11 −6 GVFS/GVFS.Common/ConsoleHelper.cs
  21. +7 −84 GVFS/GVFS.Common/Enlistment.cs
  22. +0 −41 GVFS/GVFS.Common/EnlistmentUtils.cs
  23. +1 −1 GVFS/GVFS.Common/FileBasedLock.cs
  24. +1 −1 GVFS/GVFS.Common/{Physical → }/FileSystem/DirectoryItemInfo.cs
  25. +1 −1 GVFS/GVFS.Common/{Physical → }/FileSystem/FileProperties.cs
  26. +220 −0 GVFS/GVFS.Common/FileSystem/GvFltFilter.cs
  27. +6 −2 GVFS/GVFS.Common/{Physical → }/FileSystem/PhysicalFileSystem.cs
  28. +19 −18 GVFS/GVFS.Common/GVFS.Common.csproj
  29. +4 −1 GVFS/GVFS.Common/GVFSConfig.cs
  30. +34 −1 GVFS/GVFS.Common/GVFSConstants.cs
  31. +2 −2 GVFS/GVFS.Common/GVFSContext.cs
  32. +92 −61 GVFS/GVFS.Common/GVFSEnlistment.cs
  33. +121 −0 GVFS/GVFS.Common/GVFSLock.Shared.cs
  34. +11 −28 GVFS/GVFS.Common/GVFSLock.cs
  35. +42 −22 GVFS/GVFS.Common/{Physical → }/Git/GVFSGitObjects.cs
  36. +38 −46 GVFS/GVFS.Common/Git/GitAuthentication.cs
  37. +2 −4 GVFS/GVFS.Common/Git/GitConfigHelper.cs
  38. +8 −6 GVFS/GVFS.Common/Git/GitObjects.cs
  39. +91 −98 GVFS/GVFS.Common/Git/GitProcess.cs
  40. +2 −2 GVFS/GVFS.Common/Git/GitRefs.cs
  41. +53 −5 GVFS/GVFS.Common/{Physical → }/Git/GitRepo.cs
  42. +0 −26 GVFS/GVFS.Common/Git/GitTreeEntry.cs
  43. +0 −94 GVFS/GVFS.Common/Git/LibGit2Helpers.cs
  44. +165 −49 GVFS/GVFS.Common/Git/LibGit2Repo.cs
  45. +6 −3 GVFS/GVFS.Common/Git/RefLogEntry.cs
  46. +135 −0 GVFS/GVFS.Common/GitCommandLineParser.cs
  47. +0 −39 GVFS/GVFS.Common/GitHelper.cs
  48. +248 −0 GVFS/GVFS.Common/Http/CacheServerInfo.cs
  49. +6 −10 GVFS/GVFS.Common/Http/ConfigHttpRequestor.cs
  50. +38 −20 GVFS/GVFS.Common/Http/GitObjectsHttpRequestor.cs
  51. +20 −20 GVFS/GVFS.Common/Http/HttpRequestor.cs
  52. +1 −1 GVFS/GVFS.Common/NamedPipes/NamedPipeClient.cs
  53. +46 −31 GVFS/GVFS.Common/NamedPipes/NamedPipeMessages.cs
  54. +7 −7 GVFS/GVFS.Common/{BatchedLooseObjects → NetworkStreams}/BatchedLooseObjectDeserializer.cs
  55. +6 −8 GVFS/GVFS.Common/{PrefetchPacks → NetworkStreams}/PrefetchPacksDeserializer.cs
  56. +2 −12 GVFS/GVFS.Common/{BatchedLooseObjects → NetworkStreams}/RestrictedStream.cs
  57. +1 −1 GVFS/GVFS.Common/{Physical/FileSystem → NetworkStreams}/StreamReaderExtensions.cs
  58. +77 −0 GVFS/GVFS.Common/Paths.cs
  59. +0 −47 GVFS/GVFS.Common/Physical/Git/EndianHelper.cs
  60. +0 −33 GVFS/GVFS.Common/Physical/RegistryUtils.cs
  61. +28 −1 GVFS/GVFS.Common/ProcessHelper.cs
  62. +19 −6 GVFS/GVFS.Common/ProcessWatcher.cs
  63. +14 −18 GVFS/GVFS.Common/{Physical → }/RepoMetadata.cs
  64. +9 −3 GVFS/GVFS.Common/RepoRegistration.cs
  65. +51 −0 GVFS/GVFS.Common/RetryBackoff.cs
  66. +177 −0 GVFS/GVFS.Common/RetryConfig.cs
  67. +12 −80 GVFS/GVFS.Common/RetryWrapper.cs
  68. +6 −2 GVFS/GVFS.Common/SHA1Util.cs
  69. +0 −1 GVFS/GVFS.Common/StreamUtil.cs
  70. +8 −0 GVFS/GVFS.Common/Tracing/EventMetadata.cs
  71. +0 −2 GVFS/GVFS.Common/Tracing/InProcEventListener.cs
  72. +0 −145 GVFS/GVFS.Common/WindowsProcessJob.cs
  73. +2 −0 GVFS/GVFS.FunctionalTests/GVFS.FunctionalTests.csproj
  74. +1 −1 GVFS/GVFS.FunctionalTests/Properties/Settings.Designer.cs
  75. +1 −1 GVFS/GVFS.FunctionalTests/Properties/Settings.settings
  76. +25 −23 GVFS/GVFS.FunctionalTests/Should/FileSystemShouldExtensions.cs
  77. +35 −0 GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerFixture/CacheServerTests.cs
  78. +6 −2 GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerFixture/GitMoveRenameTests.cs
  79. +91 −0 GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerFixture/UnmountTests.cs
  80. +68 −0 GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerFixture/WorkingDirectoryTests.cs
  81. +37 −3 GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/RepairTests.cs
  82. +25 −25 GVFS/GVFS.FunctionalTests/Tests/FastFetchTests.cs
  83. +20 −1 GVFS/GVFS.FunctionalTests/Tests/GitCommands/CheckoutTests.cs
  84. +1 −2 GVFS/GVFS.FunctionalTests/Tests/GitCommands/GitCommandsTests.cs
  85. +25 −0 GVFS/GVFS.FunctionalTests/Tests/GitCommands/ResetMixedTests.cs
  86. +5 −0 GVFS/GVFS.FunctionalTests/Tools/GVFSFunctionalTestEnlistment.cs
  87. +9 −4 GVFS/GVFS.FunctionalTests/Tools/GVFSProcess.cs
  88. +7 −4 GVFS/GVFS.FunctionalTests/Tools/GVFSServiceProcess.cs
  89. +0 −2 GVFS/GVFS.FunctionalTests/Tools/GitHelpers.cs
  90. +1 −1 GVFS/GVFS.FunctionalTests/app.config
  91. +296 −80 GVFS/GVFS.GVFlt/DotGit/GitIndexProjection.cs
  92. +4 −2 GVFS/GVFS.GVFlt/DotGit/IProfilerOnlyIndexProjection.cs
  93. +34 −15 GVFS/GVFS.GVFlt/DotGit/SparseCheckout.cs
  94. +2 −2 GVFS/GVFS.GVFlt/GVFS.GVFlt.csproj
  95. +269 −225 GVFS/GVFS.GVFlt/GVFltCallbacks.cs
  96. +0 −1 GVFS/GVFS.GVFlt/PathUtil.cs
  97. +3 −3 GVFS/GVFS.GvFltWrapper/AssemblyInfo.cpp
  98. +287 −0 GVFS/GVFS.GvFltWrapper/CallbackDelegates.h
  99. +6 −6 ...FS.GvFltWrapper/{GvDirectoryEnumerationFileNamesResult.h → DirectoryEnumerationFileNamesResult.h}
  100. +5 −5 GVFS/GVFS.GvFltWrapper/{GvDirectoryEnumerationResult.h → DirectoryEnumerationResult.h}
  101. +12 −12 GVFS/GVFS.GvFltWrapper/{GvDirectoryEnumerationResultImpl.h → DirectoryEnumerationResultImpl.h}
  102. +1 −1 GVFS/GVFS.GvFltWrapper/GvFlt.props
  103. +31 −25 GVFS/GVFS.GvFltWrapper/{GVFS.GvFltWrapper.vcxproj → GvFlt.vcxproj}
  104. +31 −19 GVFS/GVFS.GvFltWrapper/{GVFS.GvFltWrapper.vcxproj.filters → GvFlt.vcxproj.filters}
  105. +0 −66 GVFS/GVFS.GvFltWrapper/GvFltCallbackDelegates.h
  106. +5 −5 GVFS/GVFS.GvFltWrapper/GvFltException.cpp
  107. +8 −7 GVFS/GVFS.GvFltWrapper/GvFltException.h
  108. +0 −211 GVFS/GVFS.GvFltWrapper/GvFltWrapper.h
  109. +0 −17 GVFS/GVFS.GvFltWrapper/GvNotificationType.h
  110. +0 −13 GVFS/GVFS.GvFltWrapper/GvUpdateType.h
  111. +14 −12 GVFS/GVFS.GvFltWrapper/HResult.h
  112. +30 −0 GVFS/GVFS.GvFltWrapper/ITracer.h
  113. +1 −1 GVFS/GVFS.GvFltWrapper/IoStatusBlockValue.h
  114. +1 −1 GVFS/GVFS.GvFltWrapper/NativeEnumerationResultUtils.h
  115. +17 −0 GVFS/GVFS.GvFltWrapper/NotificationType.h
  116. +39 −0 GVFS/GVFS.GvFltWrapper/NtStatus.h
  117. +4 −0 GVFS/GVFS.GvFltWrapper/Scripts/CreateCliAssemblyVersion.bat
  118. +10 −0 GVFS/GVFS.GvFltWrapper/Scripts/CreateVersionHeader.bat
  119. +0 −38 GVFS/GVFS.GvFltWrapper/StatusCode.h
  120. +1 −1 GVFS/GVFS.GvFltWrapper/Stdafx.cpp
  121. +2 −2 GVFS/GVFS.GvFltWrapper/Stdafx.h
  122. +2 −2 GVFS/GVFS.GvFltWrapper/{GvUpdateFailureCause.h → UpdateFailureCause.h}
  123. +13 −0 GVFS/GVFS.GvFltWrapper/UpdateType.h
  124. +1 −1 GVFS/GVFS.GvFltWrapper/Utils.h
  125. BIN GVFS/GVFS.GvFltWrapper/Version.rc
  126. +260 −275 GVFS/GVFS.GvFltWrapper/{GvFltWrapper.cpp → VirtualizationInstance.cpp}
  127. +556 −0 GVFS/GVFS.GvFltWrapper/VirtualizationInstance.h
  128. +10 −10 GVFS/GVFS.GvFltWrapper/{GVFltWriteBuffer.cpp → WriteBuffer.cpp}
  129. +5 −5 GVFS/GVFS.GvFltWrapper/{GVFltWriteBuffer.h → WriteBuffer.h}
  130. +1 −1 GVFS/GVFS.GvFltWrapper/packages.config
  131. +6 −3 GVFS/GVFS.Hooks/GVFS.Hooks.csproj
  132. +46 −112 GVFS/GVFS.Hooks/Program.cs
  133. +2 −2 GVFS/GVFS.Mount/GVFS.Mount.csproj
  134. +17 −43 GVFS/GVFS.Mount/InProcessMount.cs
  135. +32 −24 GVFS/GVFS.Mount/InProcessMountVerb.cs
  136. +0 −4 GVFS/GVFS.Mount/MountAbortedException.cs
  137. +0 −13 GVFS/GVFS.Mount/MountParameters.cs
  138. +0 −1 GVFS/GVFS.Service.UI/GVFS.Service.UI.csproj
  139. +41 −1 GVFS/GVFS.Service.UI/Program.cs
  140. +0 −51 GVFS/GVFS.Service.UI/ToastHelper.cs
  141. +1 −2 GVFS/GVFS.Service/Configuration.cs
  142. +45 −41 GVFS/GVFS.Service/{ProcessAsCurrentUser.cs → CurrentUser.cs}
  143. +8 −6 GVFS/GVFS.Service/GVFS.Service.csproj
  144. +37 −133 GVFS/GVFS.Service/GVFSMountProcess.cs
  145. +0 −29 GVFS/GVFS.Service/GVFSServiceInstaller.cs
  146. +24 −39 GVFS/GVFS.Service/GvfsService.cs
  147. +45 −0 GVFS/GVFS.Service/Handlers/AttachGvFltHandler.cs
  148. +0 −58 GVFS/GVFS.Service/Handlers/MountHandler.cs
  149. +4 −5 GVFS/GVFS.Service/Handlers/NotificationHandler.cs
  150. +52 −0 GVFS/GVFS.Service/Handlers/RegisterRepoHandler.cs
  151. +0 −143 GVFS/GVFS.Service/Handlers/UnmountHandler.cs
  152. +48 −0 GVFS/GVFS.Service/Handlers/UnregisterRepoHandler.cs
  153. +83 −66 GVFS/GVFS.Service/RepoRegistry.cs
  154. +12 −0 GVFS/GVFS.Tests/Should/ValueShouldExtensions.cs
  155. +7 −7 GVFS/GVFS.UnitTests/CommandLine/{HooksInstallHelperTests.cs → HooksInstallerTests.cs}
  156. +200 −0 GVFS/GVFS.UnitTests/Common/CacheServerInfoTests.cs
  157. +71 −0 GVFS/GVFS.UnitTests/Common/GitCommandLineParserTests.cs
  158. +1 −5 GVFS/GVFS.UnitTests/Common/GitConfigHelperTests.cs
  159. +0 −73 GVFS/GVFS.UnitTests/Common/GitHelperTests.cs
  160. +11 −0 GVFS/GVFS.UnitTests/Common/RefLogEntryTests.cs
  161. +85 −0 GVFS/GVFS.UnitTests/Common/RetryBackoffTests.cs
  162. +111 −0 GVFS/GVFS.UnitTests/Common/RetryConfigTests.cs
  163. +15 −15 GVFS/GVFS.UnitTests/Common/RetryWrapperTests.cs
  164. +50 −0 GVFS/GVFS.UnitTests/Common/SHA1UtilTests.cs
  165. +3 −0 GVFS/GVFS.UnitTests/Data/Version1Registry
  166. +1 −9 GVFS/GVFS.UnitTests/FastFetch/BatchObjectDownloadJobTests.cs
  167. +32 −11 GVFS/GVFS.UnitTests/FastFetch/DiffHelperTests.cs
  168. +1 −1 GVFS/GVFS.UnitTests/FastFetch/FastFetchTracingTests.cs
  169. +28 −15 GVFS/GVFS.UnitTests/GVFS.UnitTests.csproj
  170. +1 −1 GVFS/GVFS.UnitTests/GVFlt/{Physical → DotGit}/FileSerializerTests.cs
  171. +48 −35 GVFS/GVFS.UnitTests/{Physical/Git/PhysicalGitObjectsTests.cs → Git/GVFSGitObjectsTests.cs}
  172. +58 −69 GVFS/GVFS.UnitTests/{Physical → }/Git/GitAuthenticationTests.cs
  173. +1 −3 GVFS/GVFS.UnitTests/Mock/Common/MockEnlistment.cs
  174. +7 −2 GVFS/GVFS.UnitTests/Mock/{Physical → }/FileSystem/MassiveMockFileSystem.cs
  175. +2 −2 GVFS/GVFS.UnitTests/Mock/{Physical → }/FileSystem/MockDirectory.cs
  176. +2 −2 GVFS/GVFS.UnitTests/Mock/{Physical → }/FileSystem/MockFile.cs
  177. +7 −2 GVFS/GVFS.UnitTests/Mock/{Physical → }/FileSystem/MockFileSystem.cs
  178. +1 −5 GVFS/GVFS.UnitTests/Mock/{Physical → }/FileSystem/MockSafeHandle.cs
  179. +4 −5 GVFS/GVFS.UnitTests/Mock/{Physical → }/Git/MockBatchHttpGitObjects.cs
  180. +39 −0 GVFS/GVFS.UnitTests/Mock/Git/MockGVFSGitObjects.cs
  181. +39 −0 GVFS/GVFS.UnitTests/Mock/Git/MockGitProcess.cs
  182. +2 −4 GVFS/GVFS.UnitTests/Mock/{Physical → }/Git/MockGitRepo.cs
  183. +2 −2 GVFS/GVFS.UnitTests/Mock/{Physical → }/Git/MockHttpGitObjects.cs
  184. +11 −0 GVFS/GVFS.UnitTests/Mock/MockCacheServerInfo.cs
  185. +0 −47 GVFS/GVFS.UnitTests/Mock/Physical/Git/MockGVFSGitObjects.cs
  186. +1 −1 GVFS/GVFS.UnitTests/Mock/{Physical → }/ReusableMemoryStream.cs
  187. +1 −1 GVFS/GVFS.UnitTests/Prefetch/PrefetchPacksDeserializerTests.cs
  188. +7 −1 GVFS/GVFS.UnitTests/Program.cs
  189. +85 −0 GVFS/GVFS.UnitTests/Service/RepoRegistryTests.cs
  190. +1 −1 GVFS/GVFS.UnitTests/Should/StringShouldExtensions.cs
  191. +3 −4 GVFS/GVFS.UnitTests/Virtual/CommonRepoSetup.cs
  192. +106 −0 GVFS/GVFS/CommandLine/CacheServerVerb.cs
  193. +7 −7 GVFS/GVFS/CommandLine/CloneHelper.cs
  194. +61 −46 GVFS/GVFS/CommandLine/CloneVerb.cs
  195. +2 −2 GVFS/GVFS/CommandLine/DehydrateVerb.cs
  196. +52 −14 GVFS/GVFS/CommandLine/DiagnoseVerb.cs
  197. +84 −53 GVFS/GVFS/CommandLine/GVFSVerb.cs
  198. +1 −4 GVFS/GVFS/CommandLine/{HooksInstallHelper.cs → HooksInstaller.cs}
  199. +24 −7 GVFS/GVFS/CommandLine/LogVerb.cs
  200. +157 −44 GVFS/GVFS/CommandLine/MountVerb.cs
  201. +2 −3 GVFS/GVFS/CommandLine/PrefetchHelper.cs
  202. +149 −80 GVFS/GVFS/CommandLine/PrefetchVerb.cs
  203. +6 −15 GVFS/GVFS/CommandLine/RepairJobs/BackgroundOperationDatabaseRepairJob.cs
  204. +8 −29 GVFS/GVFS/CommandLine/RepairJobs/BlobSizeDatabaseRepairJob.cs
  205. +116 −0 GVFS/GVFS/CommandLine/RepairJobs/GitConfigRepairJob.cs
  206. +8 −12 GVFS/GVFS/CommandLine/RepairJobs/GitHeadRepairJob.cs
  207. +91 −0 GVFS/GVFS/CommandLine/RepairJobs/GitIndexRepairJob.cs
  208. +6 −15 GVFS/GVFS/CommandLine/RepairJobs/PlaceholderDatabaseRepairJob.cs
  209. +128 −2 GVFS/GVFS/CommandLine/RepairJobs/RepairJob.cs
  210. +6 −15 GVFS/GVFS/CommandLine/RepairJobs/RepoMetadataDatabaseRepairJob.cs
  211. +31 −18 GVFS/GVFS/CommandLine/RepairVerb.cs
  212. +1 −1 GVFS/GVFS/CommandLine/StatusVerb.cs
  213. +143 −19 GVFS/GVFS/CommandLine/UnmountVerb.cs
  214. +10 −6 GVFS/GVFS/GVFS.csproj
  215. +24 −1 GVFS/GVFS/Program.cs
  216. +11 −9 GVFS/GVFS/Setup.iss
  217. +17 −7 Protocol.md
  218. +4 −0 Scripts/SetupDevService.bat
  219. +4 −0 Scripts/StartDevService.bat
  220. +4 −0 Scripts/StopDevService.bat
View
@@ -22,7 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GVFS", "GVFS", "{2EF2EC94-3
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.GVFlt", "GVFS\GVFS.GVFlt\GVFS.GVFlt.csproj", "{1118B427-7063-422F-83B9-5023C8EC5A7A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GVFS.GvFltWrapper", "GVFS\GVFS.GvFltWrapper\GVFS.GvFltWrapper.vcxproj", "{FB0831AE-9997-401B-B31F-3A065FDBEB20}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GvFlt", "GVFS\GVFS.GvFltWrapper\GvFlt.vcxproj", "{FB0831AE-9997-401B-B31F-3A065FDBEB20}"
ProjectSection(ProjectDependencies) = postProject
{5A6656D5-81C7-472C-9DC8-32D071CB2258} = {5A6656D5-81C7-472C-9DC8-32D071CB2258}
{374BF1E5-0B2D-4D4A-BD5E-4212299DEF09} = {374BF1E5-0B2D-4D4A-BD5E-4212299DEF09}
@@ -61,10 +61,15 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.Hooks", "GVFS\GVFS.Hooks\GVFS.Hooks.csproj", "{BDA91EE5-C684-4FC5-A90A-B7D677421917}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.Service", "GVFS\GVFS.Service\GVFS.Service.csproj", "{B8C1DFBA-CAFD-4F7E-A1A3-E11907B5467B}"
ProjectSection(ProjectDependencies) = postProject
{5A6656D5-81C7-472C-9DC8-32D071CB2258} = {5A6656D5-81C7-472C-9DC8-32D071CB2258}
{BDA91EE5-C684-4FC5-A90A-B7D677421917} = {BDA91EE5-C684-4FC5-A90A-B7D677421917}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GVFS.Mount", "GVFS\GVFS.Mount\GVFS.Mount.csproj", "{17498502-AEFF-4E70-90CC-1D0B56A8ADF5}"
ProjectSection(ProjectDependencies) = postProject
{5A6656D5-81C7-472C-9DC8-32D071CB2258} = {5A6656D5-81C7-472C-9DC8-32D071CB2258}
{BDA91EE5-C684-4FC5-A90A-B7D677421917} = {BDA91EE5-C684-4FC5-A90A-B7D677421917}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GVFS.ReadObjectHook", "GVFS\GVFS.ReadObjectHook\GVFS.ReadObjectHook.vcxproj", "{5A6656D5-81C7-472C-9DC8-32D071CB2258}"
@@ -2,10 +2,12 @@
using FastFetch.Jobs;
using GVFS.Common;
using GVFS.Common.Git;
using GVFS.Common.Http;
using GVFS.Common.Tracing;
using Microsoft.Diagnostics.Tracing;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace FastFetch
@@ -18,12 +20,13 @@ public class CheckoutFetchHelper : FetchHelper
public CheckoutFetchHelper(
ITracer tracer,
Enlistment enlistment,
GitObjectsHttpRequestor objectRequestor,
int chunkSize,
int searchThreadCount,
int downloadThreadCount,
int indexThreadCount,
int checkoutThreadCount,
bool allowIndexMetadataUpdateFromWorkingTree) : base(tracer, enlistment, chunkSize, searchThreadCount, downloadThreadCount, indexThreadCount)
bool allowIndexMetadataUpdateFromWorkingTree) : base(tracer, enlistment, objectRequestor, chunkSize, searchThreadCount, downloadThreadCount, indexThreadCount)
{
this.checkoutThreadCount = checkoutThreadCount;
this.allowIndexMetadataUpdateFromWorkingTree = allowIndexMetadataUpdateFromWorkingTree;
@@ -51,7 +54,7 @@ public override void FastFetch(string branchOrCommit, bool isBranch)
throw new FetchException("Could not find branch {0} in info/refs from: {1}", branchOrCommit, this.Enlistment.RepoUrl);
}
commitToFetch = refs.GetTipCommitIds().Single();
commitToFetch = refs.GetTipCommitId(branchOrCommit);
}
else
{
@@ -98,7 +101,7 @@ public override void FastFetch(string branchOrCommit, bool isBranch)
if (isBranch)
{
// Update the refspec before setting the upstream or git will complain the remote branch doesn't exist
this.HasFailures |= !RefSpecHelpers.UpdateRefSpec(this.Tracer, this.Enlistment, branchOrCommit, refs);
this.HasFailures |= !this.UpdateRefSpec(this.Tracer, this.Enlistment, branchOrCommit, refs);
using (ITracer activity = this.Tracer.StartActivity("SetUpstream", EventLevel.Informational))
{
@@ -113,27 +116,30 @@ public override void FastFetch(string branchOrCommit, bool isBranch)
}
}
bool indexSigningIsOff = this.GetIsIndexSigningOff();
bool shouldSignIndex = !this.GetIsIndexSigningOff();
// Update the index
EventMetadata updateIndexMetadata = new EventMetadata();
updateIndexMetadata.Add("IndexSigningIsOff", indexSigningIsOff);
updateIndexMetadata.Add("IndexSigningIsOff", shouldSignIndex);
using (ITracer activity = this.Tracer.StartActivity("UpdateIndex", EventLevel.Informational, Keywords.Telemetry, updateIndexMetadata))
{
// Create the index object now so it can track the current index
Index index = indexSigningIsOff ? new Index(this.Enlistment.EnlistmentRoot, activity) : null;
GitIndexGenerator indexGen = new GitIndexGenerator(this.Tracer, this.Enlistment, !indexSigningIsOff);
indexGen.CreateFromHeadTree();
this.HasFailures = indexGen.HasFailures;
if (!indexGen.HasFailures && index != null)
Index sourceIndex = this.GetSourceIndex();
GitIndexGenerator indexGen = new GitIndexGenerator(this.Tracer, this.Enlistment, shouldSignIndex);
indexGen.CreateFromHeadTree(indexVersion: 2);
this.HasFailures |= indexGen.HasFailures;
if (!indexGen.HasFailures)
{
Index newIndex = new Index(
this.Enlistment.EnlistmentRoot,
this.Tracer,
Path.Combine(this.Enlistment.DotGitRoot, GVFSConstants.DotGit.IndexName),
readOnly: false);
// Update from disk only if the caller says it is ok via command line
// or if we updated the whole tree and know that all files are up to date
bool allowIndexMetadataUpdateFromWorkingTree = this.allowIndexMetadataUpdateFromWorkingTree || checkout.UpdatedWholeTree;
index.UpdateFileSizesAndTimes(checkout.AddedOrEditedLocalFiles, allowIndexMetadataUpdateFromWorkingTree);
newIndex.UpdateFileSizesAndTimes(checkout.AddedOrEditedLocalFiles, allowIndexMetadataUpdateFromWorkingTree, shouldSignIndex, sourceIndex);
}
}
}
@@ -146,24 +152,44 @@ public override void FastFetch(string branchOrCommit, bool isBranch)
/// </summary>
protected override void UpdateRefs(string branchOrCommit, bool isBranch, GitRefs refs)
{
UpdateRefsHelper refHelper = new UpdateRefsHelper(this.Enlistment);
if (isBranch)
{
KeyValuePair<string, string> remoteRef = refs.GetBranchRefPairs().Single();
string remoteBranch = remoteRef.Key;
string fullLocalBranchName = branchOrCommit.StartsWith("refs/heads/") ? branchOrCommit : ("refs/heads/" + branchOrCommit);
this.HasFailures |= !refHelper.UpdateRef(this.Tracer, fullLocalBranchName, remoteRef.Value);
this.HasFailures |= !refHelper.UpdateRef(this.Tracer, "HEAD", fullLocalBranchName);
string fullLocalBranchName = branchOrCommit.StartsWith(RefsHeadsGitPath) ? branchOrCommit : (RefsHeadsGitPath + branchOrCommit);
this.HasFailures |= !this.UpdateRef(this.Tracer, fullLocalBranchName, remoteRef.Value);
this.HasFailures |= !this.UpdateRef(this.Tracer, "HEAD", fullLocalBranchName);
}
else
{
this.HasFailures |= !refHelper.UpdateRef(this.Tracer, "HEAD", branchOrCommit);
this.HasFailures |= !this.UpdateRef(this.Tracer, "HEAD", branchOrCommit);
}
base.UpdateRefs(branchOrCommit, isBranch, refs);
}
private Index GetSourceIndex()
{
string indexPath = Path.Combine(this.Enlistment.DotGitRoot, GVFSConstants.DotGit.IndexName);
string backupIndexPath = Path.Combine(this.Enlistment.DotGitRoot, GVFSConstants.DotGit.IndexName + ".backup");
if (File.Exists(indexPath))
{
// Note that this moves the current index, leaving nothing behind
// This is intentional as we only need it for the purpose of updating the
// new index and leaving it behind can make updating slower.
this.Tracer.RelatedEvent(EventLevel.Informational, "CreateBackup", new EventMetadata() { { "BackupIndexName", backupIndexPath } });
File.Delete(backupIndexPath);
File.Move(indexPath, backupIndexPath);
Index output = new Index(this.Enlistment.EnlistmentRoot, this.Tracer, backupIndexPath, readOnly: true);
output.Parse();
return output;
}
return null;
}
private bool GetIsIndexSigningOff()
{
@@ -67,13 +67,14 @@
<Compile Include="FastFetchVerb.cs" />
<Compile Include="CheckoutFetchHelper.cs" />
<Compile Include="FetchHelper.cs" />
<Compile Include="Git\BigEndianReader.cs" />
<Compile Include="Git\EndianHelper.cs" />
<Compile Include="Git\GitIndexGenerator.cs" />
<Compile Include="HashingStream.cs" />
<Compile Include="WorkingTree.cs" />
<Compile Include="GitEnlistment.cs" />
<Compile Include="Git\DiffHelper.cs" />
<Compile Include="Git\GitPackIndex.cs" />
<Compile Include="Git\RefSpecHelpers.cs" />
<Compile Include="Index.cs" />
<Compile Include="Jobs\BatchObjectDownloadJob.cs" />
<Compile Include="Jobs\CheckoutJob.cs" />
@@ -83,7 +84,6 @@
<Compile Include="Jobs\FindMissingBlobsJob.cs" />
<Compile Include="Jobs\IndexPackJob.cs" />
<Compile Include="Jobs\Job.cs" />
<Compile Include="Git\UpdateRefsHelper.cs" />
<Compile Include="PathConverter.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -1,6 +1,7 @@
using CommandLine;
using GVFS.Common;
using GVFS.Common.Git;
using GVFS.Common.Http;
using GVFS.Common.Tracing;
using Microsoft.Diagnostics.Tracing;
using System;
@@ -87,9 +88,9 @@ public class FastFetchVerb
"max-retries",
Required = false,
Default = 10,
HelpText = "Sets the maximum number of retries for downloading a pack")]
HelpText = "Sets the maximum number of attempts for downloading a pack")]
public int MaxRetries { get; set; }
public int MaxAttempts { get; set; }
[Option(
"git-path",
@@ -157,17 +158,15 @@ private int ExecuteWithExitCode()
Console.WriteLine("Cannot specify both a commit sha and a branch name.");
return ExitFailure;
}
this.CacheServerUrl = Enlistment.StripObjectsEndpointSuffix(this.CacheServerUrl);
this.SearchThreadCount = this.SearchThreadCount > 0 ? this.SearchThreadCount : Environment.ProcessorCount;
this.DownloadThreadCount = this.DownloadThreadCount > 0 ? this.DownloadThreadCount : Math.Min(Environment.ProcessorCount, MaxDefaultDownloadThreads);
this.IndexThreadCount = this.IndexThreadCount > 0 ? this.IndexThreadCount : Environment.ProcessorCount;
this.CheckoutThreadCount = this.CheckoutThreadCount > 0 ? this.CheckoutThreadCount : Environment.ProcessorCount;
this.GitBinPath = !string.IsNullOrWhiteSpace(this.GitBinPath) ? this.GitBinPath : GitProcess.GetInstalledGitBinPath();
GitEnlistment enlistment = GitEnlistment.CreateFromCurrentDirectory(this.CacheServerUrl, this.GitBinPath);
GitEnlistment enlistment = GitEnlistment.CreateFromCurrentDirectory(this.GitBinPath);
if (enlistment == null)
{
Console.WriteLine("Must be run within a git repo");
@@ -206,19 +205,28 @@ private int ExecuteWithExitCode()
string fastfetchLogFile = Enlistment.GetNewLogFileName(enlistment.FastFetchLogRoot, "fastfetch");
tracer.AddLogFileEventListener(fastfetchLogFile, EventLevel.Informational, Keywords.Any);
RetryConfig retryConfig = new RetryConfig(this.MaxAttempts, TimeSpan.FromMinutes(RetryConfig.FetchAndCloneTimeoutMinutes));
string error;
CacheServerInfo cacheServer;
if (!CacheServerInfo.TryDetermineCacheServer(this.CacheServerUrl, tracer, enlistment, retryConfig, out cacheServer, out error))
{
tracer.RelatedError(error);
return ExitFailure;
}
tracer.WriteStartEvent(
enlistment.EnlistmentRoot,
enlistment.RepoUrl,
enlistment.CacheServerUrl,
cacheServer.Url,
new EventMetadata
{
{ "TargetCommitish", commitish },
{ "Checkout", this.Checkout },
});
FetchHelper fetchHelper = this.GetFetchHelper(tracer, enlistment);
fetchHelper.MaxRetries = this.MaxRetries;
FetchHelper fetchHelper = this.GetFetchHelper(tracer, enlistment, cacheServer, retryConfig);
if (!FetchHelper.TryLoadPathWhitelist(tracer, this.PathWhitelist, this.PathWhitelistFile, enlistment, fetchHelper.PathWhitelist))
{
return ExitFailure;
@@ -254,7 +262,7 @@ private int ExecuteWithExitCode()
"Fetching",
output: Console.Out,
showSpinner: !Console.IsOutputRedirected,
suppressGvfsLogMessage: true);
gvfsLogEnlistmentRoot: null);
Console.WriteLine();
Console.WriteLine("See the full log at " + fastfetchLogFile);
@@ -284,13 +292,16 @@ private int ExecuteWithExitCode()
}
}
private FetchHelper GetFetchHelper(ITracer tracer, Enlistment enlistment)
private FetchHelper GetFetchHelper(ITracer tracer, Enlistment enlistment, CacheServerInfo cacheServer, RetryConfig retryConfig)
{
GitObjectsHttpRequestor objectRequestor = new GitObjectsHttpRequestor(tracer, enlistment, cacheServer, retryConfig);
if (this.Checkout)
{
return new CheckoutFetchHelper(
tracer,
enlistment,
objectRequestor,
this.ChunkSize,
this.SearchThreadCount,
this.DownloadThreadCount,
@@ -303,6 +314,7 @@ private FetchHelper GetFetchHelper(ITracer tracer, Enlistment enlistment)
return new FetchHelper(
tracer,
enlistment,
objectRequestor,
this.ChunkSize,
this.SearchThreadCount,
this.DownloadThreadCount,
Oops, something went wrong.

0 comments on commit 153006d

Please sign in to comment.