Skip to content

Commit

Permalink
Merge pull request jzoss#97 from jzoss/dev
Browse files Browse the repository at this point in the history
1.8 Release
  • Loading branch information
jzoss authored May 23, 2018
2 parents 2baaddd + 3c587f4 commit 4b45abe
Show file tree
Hide file tree
Showing 133 changed files with 309 additions and 165 deletions.
7 changes: 7 additions & 0 deletions BasicSccProvider.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitUI", "GitUI\GitUI.csproj", "{C756204F-28E1-473A-8160-E697E3303F1B}"
EndProject
Global
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Expand Down Expand Up @@ -81,8 +84,12 @@ Global
{C756204F-28E1-473A-8160-E697E3303F1B} = {18163F1B-3192-4F2B-9A52-40FAC3DD337C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {884473A6-8904-4214-ADC0-EA722BC8D5BB}
RESX_PrefixTranslations = False
EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = BasicSccProvider.vsmdi
EndGlobalSection
Expand Down
7 changes: 2 additions & 5 deletions DiffClassifier/DiffClassifier.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DiffClassifier</RootNamespace>
<AssemblyName>DiffClassifier</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand Down Expand Up @@ -75,9 +75,6 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\Microsoft.VisualStudio.Threading.Analyzers.14.1.114-pre\tools\Microsoft.VisualStudio.Threading.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
13 changes: 3 additions & 10 deletions GitApi/GitApi.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.129\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.129\build\LibGit2Sharp.NativeBinaries.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -9,7 +8,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GitScc</RootNamespace>
<AssemblyName>GitApi2</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
Expand Down Expand Up @@ -37,8 +36,8 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="LibGit2Sharp, Version=0.22.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333, processorArchitecture=MSIL">
<HintPath>..\packages\LibGit2Sharp.0.22.0\lib\net40\LibGit2Sharp.dll</HintPath>
<Reference Include="LibGit2Sharp, Version=0.25.0.0, Culture=neutral, PublicKeyToken=8dc08a07cc4103eb, processorArchitecture=MSIL">
<HintPath>..\_LibGit2Sharp\LibGit2Sharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nito.AsyncEx, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down Expand Up @@ -113,12 +112,6 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<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>
</PropertyGroup>
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.129\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.129\build\LibGit2Sharp.NativeBinaries.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
21 changes: 13 additions & 8 deletions GitApi/GitRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public GitRepository(string directory)
_gitEventObservable.Subscribe(x => Task.Run(async () => await DecodeGitEvents()));

_fileChangedEventObservable = Observable.FromEventPattern(ev => _fileEvent += ev, ev => _fileEvent -= ev)
.Throttle(TimeSpan.FromMilliseconds(250));
.Throttle(TimeSpan.FromMilliseconds(350));
_fileChangedEventObservable.Subscribe(x => Task.Run(async () => await FileChangedEvent()));

}
Expand Down Expand Up @@ -195,6 +195,11 @@ private async Task CreateGitFileEvent(FileSystemEventArgs e)

private bool FileIgnored(string filepath)
{
//maybe don't worry about node_modules
if (filepath.ToLower().Contains("node_modules"))
{
return true;
}
var extension = Path.GetExtension(filepath)?.ToLower();

if (extension != null && (string.Equals(extension, ".suo") || extension.EndsWith("~")))
Expand Down Expand Up @@ -396,13 +401,13 @@ public GitActionResult<GitBranchInfo> Checkout(GitBranchInfo info, bool force =
}
try
{
var checkoutBranch = repository.Checkout(branch, options);
var checkoutBranch = Commands.Checkout(repository, branch,options);
if (checkoutBranch != null)
{
result.Item = new GitBranchInfo
{
CanonicalName = checkoutBranch.CanonicalName,
RemoteName = checkoutBranch.Remote?.Name,
RemoteName = checkoutBranch.RemoteName,
Name = checkoutBranch.FriendlyName,
IsRemote = checkoutBranch.IsRemote
};
Expand Down Expand Up @@ -462,7 +467,7 @@ public void StageFile(string fileName)
{
using (var repository = GetRepository())
{
repository.Stage(fileName);
Commands.Stage(repository, fileName);
}

}
Expand All @@ -471,7 +476,7 @@ public void UnStageFile(string fileName)
{
using (var repository = GetRepository())
{
repository.Unstage(fileName);
Commands.Unstage(repository, fileName);
}
}

Expand Down Expand Up @@ -614,7 +619,7 @@ public GitActionResult<GitBranchInfo> CreateBranch(string branchName, string com
result.Item = new GitBranchInfo
{
CanonicalName = branch.CanonicalName,
RemoteName = branch.Remote?.Name,
RemoteName = branch.RemoteName,
Name = branch.FriendlyName,
IsRemote = branch.IsRemote
};
Expand Down Expand Up @@ -644,7 +649,7 @@ public GitBranchInfo CurrentBranchInfo
return new GitBranchInfo
{
CanonicalName = branch.CanonicalName,
RemoteName = branch.Remote?.Name,
RemoteName = branch.RemoteName,
Name = branch.FriendlyName,
IsRemote = branch.IsRemote,
Sha = branch.Tip?.Sha,
Expand Down Expand Up @@ -730,7 +735,7 @@ private GitBranchInfo CreateBranchInfoFromBranch(Branch branch)
return new GitBranchInfo
{
CanonicalName = branch.CanonicalName,
RemoteName = branch.Remote?.Name,
RemoteName = branch.RemoteName,
Name = branch.FriendlyName,
IsRemote = branch.IsRemote,
Sha = branch.Tip?.Sha,
Expand Down
8 changes: 3 additions & 5 deletions GitApi/packages.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LibGit2Sharp" version="0.22.0" targetFramework="net452" />
<package id="LibGit2Sharp.NativeBinaries" version="1.0.129" targetFramework="net452" />
<package id="Nito.AsyncEx" version="3.0.1" targetFramework="net452" />
<package id="System.Reactive" version="3.0.0" targetFramework="net452" />
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net452" />
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net452" />
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="net452" />
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="net452" />
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="net452" requireReinstallation="true" />
<package id="System.Reactive.Windows.Threading" version="3.0.0" targetFramework="net452" />
</packages>
51 changes: 34 additions & 17 deletions GitSccProvider/BasicSccProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using Process = System.Diagnostics.Process;
using Task = System.Threading.Tasks.Task;
using System.Text;
using System.Threading;

namespace GitScc
{
Expand All @@ -38,7 +39,7 @@ namespace GitScc
// Register the package to have information displayed in Help/About dialog box
[MsVsShell.InstalledProductRegistration("#100", "#101", Vsix.Version, IconResourceID = CommandId.iiconProductIcon)]
// Declare that resources for the package are to be found in the managed assembly resources, and not in a satellite dll
[MsVsShell.PackageRegistration(UseManagedResourcesOnly = true)]
[MsVsShell.PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
// Register the resource ID of the CTMENU section (generated from compiling the VSCT file), so the IDE will know how to merge this package's menus with the rest of the IDE when "devenv /setup" is run
// The menu resource ID needs to match the ResourceName number defined in the csproj project file in the VSCTCompile section
// Everytime the version number changes VS will automatically update the menus on startup; if the version doesn't change, you will need to run manually "devenv /setup /rootsuffix:Exp" to see VSCT changes reflected in IDE
Expand All @@ -47,22 +48,22 @@ namespace GitScc
[MsVsShell.ProvideOptionPageAttribute(typeof(SccProviderOptions), "Source Control", "EZ-GIT Options", 106, 107, false)]
[ProvideToolsOptionsPageVisibility("Source Control", "EZ-GIT Options", "C4128D99-0000-41D1-A6C3-704E6C1A3DE2")]
// Register a sample tool window visible only when the provider is active
[MsVsShell.ProvideToolWindow(typeof(PendingChangesToolWindow), Style = VsDockStyle.Tabbed, Orientation = ToolWindowOrientation.Bottom)]
[ProvideToolWindow(typeof(PendingChangesToolWindow), Style = VsDockStyle.Tabbed, Orientation = ToolWindowOrientation.Bottom)]
[MsVsShell.ProvideToolWindowVisibility(typeof(PendingChangesToolWindow), "C4128D99-0000-41D1-A6C3-704E6C1A3DE2")]
//[MsVsShell.ProvideToolWindow(typeof(HistoryToolWindow), Style = VsDockStyle.Tabbed, Orientation = ToolWindowOrientation.Bottom)]
//[MsVsShell.ProvideToolWindowVisibility(typeof(HistoryToolWindow), "C4128D99-0000-41D1-A6C3-704E6C1A3DE2")]
//Register the source control provider's service (implementing IVsScciProvider interface)
[MsVsShell.ProvideService(typeof(SccProviderService), ServiceName = "Git Source Control Service")]
[MsVsShell.ProvideService(typeof(SccProviderService), ServiceName = "Git Source Control Service", IsAsyncQueryable = true)]
// Register the source control provider to be visible in Tools/Options/SourceControl/Plugin dropdown selector
[GitScc.ProvideSourceControlProvider("EZ-GIT", "#100", IsPublishSupported = true)]
//[MsVsShell.ProvideSourceControlProvider("Git Source Control Provider 2015", "#100", "{C4128D99-0000-41D1-A6C3-704E6C1A3DE2}",
// "{C4128D99-2000-41D1-A6C3-704E6C1A3DE2}", "{C4128D99-1000-41D1-A6C3-704E6C1A3DE2}", IsPublishSupported = true)]
// Pre-load the package when the command UI context is asserted (the provider will be automatically loaded after restarting the shell if it was active last time the shell was shutdown)
[MsVsShell.ProvideAutoLoad("C4128D99-0000-41D1-A6C3-704E6C1A3DE2")]
[MsVsShell.ProvideAutoLoad("C4128D99-0000-41D1-A6C3-704E6C1A3DE2", PackageAutoLoadFlags.BackgroundLoad)]
//[ProvideAutoLoad(UIContextGuids.SolutionExists)]
// Declare the package guid
[Guid("C4128D99-2000-41D1-A6C3-704E6C1A3DE2")]
public sealed class BasicSccProvider : MsVsShell.Package, IOleCommandTarget
public sealed class BasicSccProvider : MsVsShell.AsyncPackage, IOleCommandTarget
{
private SccOnIdleEvent _OnIdleEvent = new SccOnIdleEvent();
// As a best practice, to be sure the provider has an unique name, a guid like the provider guid can be used as a part of the name
Expand All @@ -87,26 +88,29 @@ public BasicSccProvider()
{
_SccProvider = this;
Trace.WriteLine(String.Format(CultureInfo.CurrentUICulture, "Entering constructor for: {0}", this.ToString()));
GitBash.GitExePath = GitSccOptions.Current.GitBashPath;
GitBash.UseUTF8FileNames = !GitSccOptions.Current.NotUseUTF8FileNames;

}

/////////////////////////////////////////////////////////////////////////////
// BasicSccProvider Package Implementation
#region Package Members

protected override void Initialize()
protected override async Task InitializeAsync(System.Threading.CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
{
Trace.WriteLine(String.Format(CultureInfo.CurrentUICulture, "Entering Initialize() of: {0}", this.ToString()));
base.Initialize();
GitBash.GitExePath = GitSccOptions.Current.GitBashPath;
GitBash.UseUTF8FileNames = !GitSccOptions.Current.NotUseUTF8FileNames;
//base.Initialize();
await base.InitializeAsync(cancellationToken, progress);

//projects = new List<GitFileStatusTracker>();
sccService = new SccProviderService(this);


((IServiceContainer)this).AddService(typeof(SccProviderService), sccService, true);
this.AddService(typeof(SccProviderService), CreateGitService, true);

await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
// Add our command handlers for menu (commands must exist in the .vsct file)
MsVsShell.OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as MsVsShell.OleMenuCommandService;
MsVsShell.OleMenuCommandService mcs = await GetServiceAsync(typeof(IMenuCommandService)) as MsVsShell.OleMenuCommandService;
if (mcs != null)
{
CommandID cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandRefresh);
Expand Down Expand Up @@ -195,20 +199,33 @@ protected override void Initialize()
ThreadHelper.ThrowIfNotOnUIThread();
// Register the provider with the source control manager
// If the package is to become active, this will also callback on OnActiveStateChange and the menu commands will be enabled
IVsRegisterScciProvider rscp = (IVsRegisterScciProvider)GetService(typeof(IVsRegisterScciProvider));
IVsRegisterScciProvider rscp = await GetServiceAsync(typeof(IVsRegisterScciProvider)) as IVsRegisterScciProvider;
rscp.RegisterSourceControlProvider(GuidList.guidSccProvider);

_OnIdleEvent.RegisterForIdleTimeCallbacks(GetGlobalService(typeof(SOleComponentManager)) as IOleComponentManager);
//_OnIdleEvent.OnIdleEvent += new OnIdleEvent(sccService.UpdateNodesGlyphs);
SetupStatusMenu();

}


public async Task<object> CreateGitService(IAsyncServiceContainer container, CancellationToken cancellationToken, Type serviceType)
{
sccService = new SccProviderService(this);
await sccService.InitializeAsync(cancellationToken);
return sccService;
}

private void SetupStatusMenu()
{
sccService.RepositoryIcon = KnownMonikers.GitNoColor;
sccService.BranchIcon = KnownMonikers.BranchNoColor;
try
{
sccService.RepositoryIcon = KnownMonikers.GitNoColor;
sccService.BranchIcon = KnownMonikers.BranchNoColor;
}
catch(Exception e)
{
Trace.WriteLine(String.Format(CultureInfo.CurrentUICulture, "Error Creating Status Menu", e.Message));
}
}

public string ProviderName
Expand Down Expand Up @@ -467,7 +484,7 @@ internal async Task RunDiffCommand(DiffFileInfo fileInfo)
if (GitSccOptions.Current.DiffTool == DiffTools.VisualStudio)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
var diffService = (IVsDifferenceService)GetService(typeof(SVsDifferenceService));
var diffService = await GetServiceAsync(typeof(SVsDifferenceService)) as IVsDifferenceService;
if (diffService != null)
{

Expand Down
2 changes: 1 addition & 1 deletion GitSccProvider/ErrorMessages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4b45abe

Please sign in to comment.