Skip to content

Commit 785ccb4

Browse files
author
Kevin Willford
committed
General improvements:
- We have improved how GVFS handles enlistments in junctions and mapped to a drive letter. - We have started porting parts of the product to .NET Standard. - Updated Git for a security issue. - Better errors around ProjFS installation issues. - Fix backoff on cache server size endpoint 404. - GVFS has a better icon. - Improved reliability of how the installer upgrades from non-inboxed to inboxed ProjFS. - Better recovery from a process that terminates without releasing the GVFS lock. - Gracefully handle a missing shared object cache pack directory. Performance improvements: - We have moved MIDX computation to a post-fetch thread. This should save blocking time per prefetch that downloads a packfile from the cache server. - We have enabled the generation of the serialized commit graph in the post-fetch thread. This should provide across-the-board perf wins in any command that walks many commits. - Improved the memory usage during MIDX computation. - Further optimizations to GVFS's index parsing, saving time on commands that need to reproject (like checkout). - Use commit graph generation numbers during force push, saving time on force pushes.
1 parent 2797fbb commit 785ccb4

507 files changed

Lines changed: 26939 additions & 12900 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33

4+
# VS 2017 user-specific files
5+
launchSettings.json
6+
47
# User-specific files
58
*.suo
69
*.user
710
*.userosscache
811
*.sln.docstates
912

13+
# Mac
14+
xcuserdata
15+
.DS_Store
16+
1017
# User-specific files (MonoDevelop/Xamarin Studio)
1118
*.userprefs
1219

GVFS.sln

Lines changed: 278 additions & 106 deletions
Large diffs are not rendered by default.

GVFS/Directory.Build.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!--This file is used to prevent build output from being written into the source tree when building with .NET Core/Standard.
4+
This file should not be parsed when building with .NET Framework.
5+
See https://github.com/Microsoft/msbuild/issues/1603#issuecomment-283104367 for more info .-->
6+
<PropertyGroup>
7+
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)\..\..\BuildOutput\$(MSBuildProjectName)\obj</BaseIntermediateOutputPath>
8+
</PropertyGroup>
9+
</Project>

GVFS/FastFetch/CheckoutFetchHelper.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
using FastFetch.Git;
2-
using FastFetch.Jobs;
3-
using GVFS.Common;
1+
using GVFS.Common;
42
using GVFS.Common.Git;
53
using GVFS.Common.Http;
4+
using GVFS.Common.Prefetch;
5+
using GVFS.Common.Prefetch.Git;
6+
using GVFS.Common.Prefetch.Jobs;
67
using GVFS.Common.Tracing;
7-
using Microsoft.Diagnostics.Tracing;
88
using System;
99
using System.Collections.Generic;
1010
using System.IO;
1111
using System.Linq;
1212

1313
namespace FastFetch
1414
{
15-
public class CheckoutFetchHelper : FetchHelper
15+
public class CheckoutFetchHelper : PrefetchHelper
1616
{
1717
private readonly bool allowIndexMetadataUpdateFromWorkingTree;
1818
private readonly int checkoutThreadCount;
@@ -33,7 +33,7 @@ public CheckoutFetchHelper(
3333
}
3434

3535
/// <param name="branchOrCommit">A specific branch to filter for, or null for all branches returned from info/refs</param>
36-
public override void FastFetch(string branchOrCommit, bool isBranch)
36+
public override void Prefetch(string branchOrCommit, bool isBranch)
3737
{
3838
if (string.IsNullOrWhiteSpace(branchOrCommit))
3939
{

GVFS/FastFetch/FastFetch.csproj

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="..\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\LibGit2Sharp.NativeBinaries.props')" />
44
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
5-
<Import Project="$(SolutionDir)\GVFS\GVFS.Build\GVFS.props" />
5+
<Import Project="$(SolutionDir)\GVFS\GVFS.Build\GVFS.cs.props" />
66
<PropertyGroup>
77
<ProjectGuid>{07F2A520-2AB7-46DD-97C0-75D8E988D55B}</ProjectGuid>
88
<OutputType>Exe</OutputType>
@@ -43,10 +43,6 @@
4343
<HintPath>..\..\..\packages\CommandLineParser.2.1.1-beta\lib\net45\CommandLine.dll</HintPath>
4444
<Private>True</Private>
4545
</Reference>
46-
<Reference Include="Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
47-
<HintPath>..\..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.28\lib\net46\Microsoft.Diagnostics.Tracing.EventSource.dll</HintPath>
48-
<Private>True</Private>
49-
</Reference>
5046
<Reference Include="System" />
5147
<Reference Include="System.Core" />
5248
<Reference Include="System.Xml.Linq" />
@@ -60,30 +56,9 @@
6056
<Compile Include="$(BuildOutputDir)\CommonAssemblyVersion.cs">
6157
<Link>CommonAssemblyVersion.cs</Link>
6258
</Compile>
63-
<Compile Include="FastFetchVerb.cs" />
6459
<Compile Include="CheckoutFetchHelper.cs" />
65-
<Compile Include="FetchHelper.cs" />
66-
<Compile Include="Git\BigEndianReader.cs" />
67-
<Compile Include="Git\EndianHelper.cs" />
68-
<Compile Include="Git\FastFetchGitObjects.cs" />
69-
<Compile Include="Git\FastFetchLibGit2Repo.cs" />
70-
<Compile Include="Git\GitIndexGenerator.cs" />
71-
<Compile Include="HashingStream.cs" />
72-
<Compile Include="Jobs\ReadFilesJob.cs" />
73-
<Compile Include="WorkingTree.cs" />
74-
<Compile Include="GitEnlistment.cs" />
75-
<Compile Include="Git\DiffHelper.cs" />
76-
<Compile Include="Git\GitPackIndex.cs" />
77-
<Compile Include="Index.cs" />
78-
<Compile Include="Jobs\BatchObjectDownloadJob.cs" />
79-
<Compile Include="Jobs\CheckoutJob.cs" />
80-
<Compile Include="Jobs\Data\BlobDownloadRequest.cs" />
81-
<Compile Include="Jobs\Data\IndexPackRequest.cs" />
82-
<Compile Include="Jobs\Data\TreeSearchRequest.cs" />
83-
<Compile Include="Jobs\FindMissingBlobsJob.cs" />
84-
<Compile Include="Jobs\IndexPackJob.cs" />
85-
<Compile Include="Jobs\Job.cs" />
86-
<Compile Include="PathConverter.cs" />
60+
<Compile Include="FastFetchVerb.cs" />
61+
<Compile Include="..\GVFS.PlatformLoader\PlatformLoader.Windows.cs" />
8762
<Compile Include="Program.cs" />
8863
<Compile Include="Properties\AssemblyInfo.cs" />
8964
</ItemGroup>
@@ -96,19 +71,25 @@
9671
<Project>{374bf1e5-0b2d-4d4a-bd5e-4212299def09}</Project>
9772
<Name>GVFS.Common</Name>
9873
</ProjectReference>
74+
<ProjectReference Include="..\GVFS.Platform.Windows\GVFS.Platform.Windows.csproj">
75+
<Project>{4ce404e7-d3fc-471c-993c-64615861ea63}</Project>
76+
<Name>GVFS.Platform.Windows</Name>
77+
</ProjectReference>
78+
<ProjectReference Include="..\GVFS.Virtualization\GVFS.Virtualization.csproj">
79+
<Project>{f468b05a-95e5-46bc-8c67-b80a78527b7d}</Project>
80+
<Name>GVFS.Virtualization</Name>
81+
</ProjectReference>
9982
</ItemGroup>
10083
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
10184
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
10285
<PropertyGroup>
10386
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
10487
</PropertyGroup>
10588
<Error Condition="!Exists('..\..\..\packages\StyleCop.Error.MSBuild.1.0.0\build\StyleCop.Error.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\StyleCop.Error.MSBuild.1.0.0\build\StyleCop.Error.MSBuild.Targets'))" />
106-
<Error Condition="!Exists('..\..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets'))" />
10789
<Error Condition="!Exists('..\..\..\packages\StyleCop.MSBuild.4.7.54.0\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\StyleCop.MSBuild.4.7.54.0\build\StyleCop.MSBuild.Targets'))" />
10890
<Error Condition="!Exists('..\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\LibGit2Sharp.NativeBinaries.props'))" />
10991
</Target>
11092
<Import Project="..\..\..\packages\StyleCop.Error.MSBuild.1.0.0\build\StyleCop.Error.MSBuild.Targets" Condition="Exists('..\..\..\packages\StyleCop.Error.MSBuild.1.0.0\build\StyleCop.Error.MSBuild.Targets')" />
111-
<Import Project="..\..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets" Condition="Exists('..\..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets')" />
11293
<Import Project="..\..\..\packages\StyleCop.MSBuild.4.7.54.0\build\StyleCop.MSBuild.Targets" Condition="Exists('..\..\..\packages\StyleCop.MSBuild.4.7.54.0\build\StyleCop.MSBuild.Targets')" />
11394
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
11495
Other similar extension points exist, see Microsoft.Common.targets.

GVFS/FastFetch/FastFetchVerb.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
using GVFS.Common;
33
using GVFS.Common.Git;
44
using GVFS.Common.Http;
5+
using GVFS.Common.Prefetch;
56
using GVFS.Common.Tracing;
6-
using Microsoft.Diagnostics.Tracing;
77
using System;
88

99
namespace FastFetch
@@ -144,7 +144,7 @@ private int ExecuteWithExitCode()
144144
{
145145
// CmdParser doesn't strip quotes, and Path.Combine will throw
146146
this.GitBinPath = this.GitBinPath.Replace("\"", string.Empty);
147-
if (!GitProcess.GitExists(this.GitBinPath))
147+
if (!GVFSPlatform.Instance.GitInstallation.GitExists(this.GitBinPath))
148148
{
149149
Console.WriteLine(
150150
"Could not find git.exe {0}",
@@ -163,7 +163,7 @@ private int ExecuteWithExitCode()
163163
this.IndexThreadCount = this.IndexThreadCount > 0 ? this.IndexThreadCount : Environment.ProcessorCount;
164164
this.CheckoutThreadCount = this.CheckoutThreadCount > 0 ? this.CheckoutThreadCount : Environment.ProcessorCount;
165165

166-
this.GitBinPath = !string.IsNullOrWhiteSpace(this.GitBinPath) ? this.GitBinPath : GitProcess.GetInstalledGitBinPath();
166+
this.GitBinPath = !string.IsNullOrWhiteSpace(this.GitBinPath) ? this.GitBinPath : GVFSPlatform.Instance.GitInstallation.GetInstalledGitBinPath();
167167

168168
GitEnlistment enlistment = GitEnlistment.CreateFromCurrentDirectory(this.GitBinPath);
169169
if (enlistment == null)
@@ -191,7 +191,7 @@ private int ExecuteWithExitCode()
191191
Console.WriteLine("The ParentActivityId provided (" + this.ParentActivityId + ") is not a valid GUID.");
192192
}
193193

194-
using (JsonEtwTracer tracer = new JsonEtwTracer("Microsoft.Git.FastFetch", parentActivityId, "FastFetch", useCriticalTelemetryFlag: false))
194+
using (JsonTracer tracer = new JsonTracer("Microsoft.Git.FastFetch", parentActivityId, "FastFetch", disableTelemetry: true))
195195
{
196196
if (this.Verbose)
197197
{
@@ -218,9 +218,9 @@ private int ExecuteWithExitCode()
218218
});
219219

220220
RetryConfig retryConfig = new RetryConfig(this.MaxAttempts, TimeSpan.FromMinutes(RetryConfig.FetchAndCloneTimeoutMinutes));
221-
FetchHelper fetchHelper = this.GetFetchHelper(tracer, enlistment, cacheServer, retryConfig);
221+
PrefetchHelper fetchHelper = this.GetFetchHelper(tracer, enlistment, cacheServer, retryConfig);
222222
string error;
223-
if (!FetchHelper.TryLoadFolderList(enlistment, this.FolderList, this.FolderListFile, fetchHelper.FolderList, out error))
223+
if (!PrefetchHelper.TryLoadFolderList(enlistment, this.FolderList, this.FolderListFile, fetchHelper.FolderList, out error))
224224
{
225225
tracer.RelatedError(error);
226226
Console.WriteLine(error);
@@ -237,10 +237,10 @@ private int ExecuteWithExitCode()
237237
try
238238
{
239239
bool isBranch = this.Commit == null;
240-
fetchHelper.FastFetch(commitish, isBranch);
240+
fetchHelper.Prefetch(commitish, isBranch);
241241
return !fetchHelper.HasFailures;
242242
}
243-
catch (FetchHelper.FetchException e)
243+
catch (PrefetchHelper.FetchException e)
244244
{
245245
tracer.RelatedError(e.Message);
246246
return false;
@@ -303,7 +303,7 @@ private string GetRemoteUrl(Enlistment enlistment)
303303
return enlistment.RepoUrl;
304304
}
305305

306-
private FetchHelper GetFetchHelper(ITracer tracer, Enlistment enlistment, CacheServerInfo cacheServer, RetryConfig retryConfig)
306+
private PrefetchHelper GetFetchHelper(ITracer tracer, Enlistment enlistment, CacheServerInfo cacheServer, RetryConfig retryConfig)
307307
{
308308
GitObjectsHttpRequestor objectRequestor = new GitObjectsHttpRequestor(tracer, enlistment, cacheServer, retryConfig);
309309

@@ -322,7 +322,7 @@ private FetchHelper GetFetchHelper(ITracer tracer, Enlistment enlistment, CacheS
322322
}
323323
else
324324
{
325-
return new FetchHelper(
325+
return new PrefetchHelper(
326326
tracer,
327327
enlistment,
328328
objectRequestor,

GVFS/FastFetch/Git/FastFetchGitObjects.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

GVFS/FastFetch/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
using CommandLine;
2+
using GVFS.PlatformLoader;
23

34
namespace FastFetch
45
{
56
public class Program
67
{
78
public static void Main(string[] args)
89
{
10+
GVFSPlatformLoader.Initialize();
911
Parser.Default.ParseArguments<FastFetchVerb>(args)
1012
.WithParsed(fastFetch => fastFetch.Execute());
1113
}

GVFS/FastFetch/package.nuspec

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<package >
3+
<metadata>
4+
<id>FastFetch</id>
5+
<version>0.1.0</version>
6+
<authors>Microsoft</authors>
7+
<projectUrl>https://github.com/Microsoft/GVFS</projectUrl>
8+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
9+
<description>
10+
An internal tool for quickly pulling large git repos from a GVFS-enabled git server.
11+
This application will be deprecated once this same functionality is added to the gvfs prefetch verb.
12+
</description>
13+
</metadata>
14+
<files>
15+
<file src="..\..\..\BuildOutput\FastFetch\bin\x64\Release\FastFetch.exe" target="tools"/>
16+
<file src="..\..\..\BuildOutput\FastFetch\bin\x64\Release\*.dll" target="tools"/>
17+
<file src="..\..\..\BuildOutput\FastFetch\bin\x64\Release\*.pdb" target="tools"/>
18+
</files>
19+
</package>

GVFS/FastFetch/packages.config

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
<packages>
33
<package id="CommandLineParser" version="2.1.1-beta" targetFramework="net461" />
44
<package id="LibGit2Sharp.NativeBinaries" version="1.0.165" targetFramework="net461" />
5-
<package id="Microsoft.Diagnostics.Tracing.EventRegister" version="1.1.28" targetFramework="net461" />
6-
<package id="Microsoft.Diagnostics.Tracing.EventSource" version="1.1.28" targetFramework="net461" />
7-
<package id="Microsoft.Diagnostics.Tracing.EventSource.Redist" version="1.1.28" targetFramework="net461" />
85
<package id="StyleCop.Error.MSBuild" version="1.0.0" targetFramework="net461" />
96
<package id="StyleCop.MSBuild" version="4.7.54.0" targetFramework="net461" developmentDependency="true" />
107
</packages>

0 commit comments

Comments
 (0)