From 759089017d85d4934e47338bc156cd7ef2e8fd2a Mon Sep 17 00:00:00 2001 From: Richard Banks Date: Wed, 27 Mar 2019 10:09:38 +1100 Subject: [PATCH 1/6] Convert to .NET Core 3.0-preview 3 --- .gitignore | 1 + Logic/InternalVisibleForTests.cs | 2 + Logic/Logic.csproj | 102 ++----------------- Logic/Properties/AssemblyInfo.cs | 38 -------- Logic/packages.config | 11 --- Tests/LogParserTests/ParseCommit.cs | 14 +-- Tests/LogRetrieverTests.cs | 11 ++- Tests/Properties/AssemblyInfo.cs | 36 ------- Tests/Tests.csproj | 83 +++------------- Tests/packages.config | 5 - UI/App.config | 6 -- UI/App.xaml | 4 +- UI/MainWindow.xaml | 2 +- UI/Properties/AssemblyInfo.cs | 55 ----------- UI/Properties/Resources.Designer.cs | 71 -------------- UI/Properties/Resources.resx | 117 ---------------------- UI/Properties/Settings.Designer.cs | 30 ------ UI/Properties/Settings.settings | 7 -- UI/UI.csproj | 145 +++------------------------- UI/packages.config | 6 -- 20 files changed, 55 insertions(+), 691 deletions(-) create mode 100644 Logic/InternalVisibleForTests.cs delete mode 100644 Logic/Properties/AssemblyInfo.cs delete mode 100644 Logic/packages.config delete mode 100644 Tests/Properties/AssemblyInfo.cs delete mode 100644 Tests/packages.config delete mode 100644 UI/App.config delete mode 100644 UI/Properties/AssemblyInfo.cs delete mode 100644 UI/Properties/Resources.Designer.cs delete mode 100644 UI/Properties/Resources.resx delete mode 100644 UI/Properties/Settings.Designer.cs delete mode 100644 UI/Properties/Settings.settings delete mode 100644 UI/packages.config diff --git a/.gitignore b/.gitignore index bdc3535..dac58bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) [Bb]in/ [Oo]bj/ +.vs # mstest test results TestResults diff --git a/Logic/InternalVisibleForTests.cs b/Logic/InternalVisibleForTests.cs new file mode 100644 index 0000000..20fb199 --- /dev/null +++ b/Logic/InternalVisibleForTests.cs @@ -0,0 +1,2 @@ +using System.Runtime.CompilerServices; +[assembly: InternalsVisibleTo("Tests")] diff --git a/Logic/Logic.csproj b/Logic/Logic.csproj index 25284cf..92ccc19 100644 --- a/Logic/Logic.csproj +++ b/Logic/Logic.csproj @@ -1,100 +1,12 @@ - - - + + - Debug - AnyCPU - {BF9333A3-490D-4C93-9F41-11016C9B324C} - Library - Properties - GitViz.Logic - GitViz.Logic - v4.5 - 512 + netcoreapp3.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\GraphSharp.1.1.0.0\lib\net40\GraphSharp.dll - - - ..\packages\GraphSharp.1.1.0.0\lib\net40\GraphSharp.Controls.dll - - - ..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.dll - - - ..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Data.dll - - - ..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Graphviz.dll - - - ..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Serialization.dll - - - - - ..\packages\Rx-Core.2.1.30214.0\lib\Net45\System.Reactive.Core.dll - - - ..\packages\Rx-Interfaces.2.1.30214.0\lib\Net45\System.Reactive.Interfaces.dll - - - ..\packages\Rx-Linq.2.1.30214.0\lib\Net45\System.Reactive.Linq.dll - - - ..\packages\Rx-PlatformServices.2.1.30214.0\lib\Net45\System.Reactive.PlatformServices.dll - - - - - - - - ..\packages\WPFExtensions.1.0.0\lib\WPFExtensions.dll - - - - - - - - - - - - - - - - - + - + + + - - \ No newline at end of file diff --git a/Logic/Properties/AssemblyInfo.cs b/Logic/Properties/AssemblyInfo.cs deleted file mode 100644 index 29a162d..0000000 --- a/Logic/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Logic")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Logic")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1e3cd963-bb28-4e8b-988f-8f5be0725f77")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - -[assembly: InternalsVisibleTo("GitViz.Tests")] diff --git a/Logic/packages.config b/Logic/packages.config deleted file mode 100644 index 2082388..0000000 --- a/Logic/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/Tests/LogParserTests/ParseCommit.cs b/Tests/LogParserTests/ParseCommit.cs index 191b1ab..ae4dd2d 100644 --- a/Tests/LogParserTests/ParseCommit.cs +++ b/Tests/LogParserTests/ParseCommit.cs @@ -1,4 +1,4 @@ -using GitViz.Logic; +using GitViz.Logic; using NUnit.Framework; namespace GitViz.Tests.LogParserTests @@ -9,27 +9,27 @@ public class ParseCommit [TestCase( "1383697102 4be5ef1", Description = "Initial commit", - Result = "{Hash:4be5ef1,CommitDate:1383697102,ShortHash:4be5ef1}")] + ExpectedResult = "{Hash:4be5ef1,CommitDate:1383697102,ShortHash:4be5ef1}")] [TestCase( "1383697102 4be5ef1 (HEAD, master)", Description = "Initial commit with head and master", - Result = "{Hash:4be5ef1,Refs:[HEAD,master],CommitDate:1383697102,ShortHash:4be5ef1}")] + ExpectedResult = "{Hash:4be5ef1,Refs:[HEAD,master],CommitDate:1383697102,ShortHash:4be5ef1}")] [TestCase( "1383697102 4be5ef1 (HEAD, origin/master, origin/HEAD, master)", Description = "Initial commit with head and remote master", - Result = "{Hash:4be5ef1,Refs:[HEAD,origin/master,origin/HEAD,master],CommitDate:1383697102,ShortHash:4be5ef1}")] + ExpectedResult = "{Hash:4be5ef1,Refs:[HEAD,origin/master,origin/HEAD,master],CommitDate:1383697102,ShortHash:4be5ef1}")] [TestCase( "1383697102 4e4224c 4be5ef1", Description = "Commit with one parent", - Result = "{Hash:4e4224c,ParentHashes:[4be5ef1],CommitDate:1383697102,ShortHash:4e4224c}")] + ExpectedResult = "{Hash:4e4224c,ParentHashes:[4be5ef1],CommitDate:1383697102,ShortHash:4e4224c}")] [TestCase( "1383697102 d472fda 3c27924 5411a9f", Description = "Commit with two parents", - Result = "{Hash:d472fda,ParentHashes:[3c27924,5411a9f],CommitDate:1383697102,ShortHash:d472fda}")] + ExpectedResult = "{Hash:d472fda,ParentHashes:[3c27924,5411a9f],CommitDate:1383697102,ShortHash:d472fda}")] [TestCase( "1383697102 d472fda 3c27924 5411a9f 6789abc", Description = "Commit with three parents", - Result = "{Hash:d472fda,ParentHashes:[3c27924,5411a9f,6789abc],CommitDate:1383697102,ShortHash:d472fda}")] + ExpectedResult = "{Hash:d472fda,ParentHashes:[3c27924,5411a9f,6789abc],CommitDate:1383697102,ShortHash:d472fda}")] public string Test(string logLine) { var commit = LogParser.ParseCommit(logLine); diff --git a/Tests/LogRetrieverTests.cs b/Tests/LogRetrieverTests.cs index e7a09f3..9a85397 100644 --- a/Tests/LogRetrieverTests.cs +++ b/Tests/LogRetrieverTests.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using GitViz.Logic; using NUnit.Framework; @@ -38,7 +38,8 @@ public void ShouldReturnSingleRecentCommitWithHashButNoParents() Assert.AreEqual(1, log.Length); var commit = log.Single(); - Assert.IsNotNullOrEmpty(commit.Hash); + Assert.IsNotNull(commit.Hash); + Assert.IsNotEmpty(commit.Hash); Assert.AreEqual(40, commit.Hash.Length); Assert.IsNull(commit.ParentHashes); } @@ -77,12 +78,14 @@ public void ShouldReturnTwoRecentCommits() Assert.AreEqual(2, log.Length); var commit = log.ElementAt(0); - Assert.IsNotNullOrEmpty(commit.Hash); + Assert.IsNotNull(commit.Hash); + Assert.IsNotEmpty(commit.Hash); Assert.AreEqual(40, commit.Hash.Length); CollectionAssert.AreEqual(new[] { log.ElementAt(1).Hash }, commit.ParentHashes); commit = log.ElementAt(1); - Assert.IsNotNullOrEmpty(commit.Hash); + Assert.IsNotNull(commit.Hash); + Assert.IsNotEmpty(commit.Hash); Assert.AreEqual(40, commit.Hash.Length); Assert.IsNull(commit.ParentHashes); } diff --git a/Tests/Properties/AssemblyInfo.cs b/Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 452bf52..0000000 --- a/Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Tests")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("74e9f26d-6c11-462d-8160-ab98e899361e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 6da335c..23a6d50 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,80 +1,21 @@ - - - + + - Debug - AnyCPU - {E9951372-AC02-47B4-BDEF-9518A5442BD1} - Library - Properties - GitViz.Tests - GitViz.Tests - v4.5 - 512 + netcoreapp3.0 + false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll - - - ..\packages\NUnit.2.6.3\lib\nunit.framework.dll - - - - - - - - - - - - - - - - - - - - - - + - - {bf9333a3-490d-4c93-9f41-11016c9b324c} - Logic - + + + + - + + - + - - \ No newline at end of file diff --git a/Tests/packages.config b/Tests/packages.config deleted file mode 100644 index 835e599..0000000 --- a/Tests/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/UI/App.config b/UI/App.config deleted file mode 100644 index 8e15646..0000000 --- a/UI/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/UI/App.xaml b/UI/App.xaml index 35ce31d..a1408a9 100644 --- a/UI/App.xaml +++ b/UI/App.xaml @@ -1,7 +1,7 @@ - + StartupUri="MainWindow.xaml"> diff --git a/UI/MainWindow.xaml b/UI/MainWindow.xaml index 93cd468..1f43def 100644 --- a/UI/MainWindow.xaml +++ b/UI/MainWindow.xaml @@ -1,7 +1,7 @@ CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/UI/Properties/Resources.Designer.cs b/UI/Properties/Resources.Designer.cs deleted file mode 100644 index 6731837..0000000 --- a/UI/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34003 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace UI.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UI.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/UI/Properties/Resources.resx b/UI/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/UI/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/UI/Properties/Settings.Designer.cs b/UI/Properties/Settings.Designer.cs deleted file mode 100644 index b42909e..0000000 --- a/UI/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34003 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace UI.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/UI/Properties/Settings.settings b/UI/Properties/Settings.settings deleted file mode 100644 index 033d7a5..0000000 --- a/UI/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/UI/UI.csproj b/UI/UI.csproj index 11b7b57..c969b01 100644 --- a/UI/UI.csproj +++ b/UI/UI.csproj @@ -1,145 +1,32 @@ - - - + + - Debug - AnyCPU - {090061EB-F7DB-4160-96D3-4B1A13F7AF7F} WinExe - Properties - UI - GitViz - v4.5 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - + netcoreapp3.0 + true readify.ico + - - ..\packages\GraphSharp.1.1.0.0\lib\net40\GraphSharp.dll - - - ..\packages\GraphSharp.1.1.0.0\lib\net40\GraphSharp.Controls.dll - - - ..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.dll - - - ..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Data.dll - - - ..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Graphviz.dll - - - ..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Serialization.dll - - - - - - - - - - - - 4.0 - - - - - - ..\packages\WPFExtensions.1.0.0\lib\WPFExtensions.dll - - - - - MSBuild:Compile - Designer - - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - - MainWindow.xaml - Code - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - + + + - + + PreserveNewest + + - - {BF9333A3-490D-4C93-9F41-11016C9B324C} - Logic - + + - + + - - \ No newline at end of file diff --git a/UI/packages.config b/UI/packages.config deleted file mode 100644 index 25b8440..0000000 --- a/UI/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 6c72dd2e6a8c725ab514d49a7359f92d723956d0 Mon Sep 17 00:00:00 2001 From: Richard Banks Date: Wed, 27 Mar 2019 11:07:54 +1100 Subject: [PATCH 2/6] fix failing test --- Tests/LogRetrieverTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/LogRetrieverTests.cs b/Tests/LogRetrieverTests.cs index 9a85397..cd235fe 100644 --- a/Tests/LogRetrieverTests.cs +++ b/Tests/LogRetrieverTests.cs @@ -58,7 +58,7 @@ public void ShouldReturnSingleRecentCommitWithLocalRefs() var log = new LogRetriever(executor).GetRecentCommits().ToArray(); var commit = log.Single(); - CollectionAssert.AreEqual(new[] { "HEAD", "master" }, commit.Refs); + CollectionAssert.AreEqual(new[] { "HEAD -> master" }, commit.Refs); } } From caad692ce83dd852a32f237e5f65df0b56b200c4 Mon Sep 17 00:00:00 2001 From: Richard Banks Date: Wed, 27 Mar 2019 11:45:13 +1100 Subject: [PATCH 3/6] a little housekeeping post netcore conversion --- Logic/GitCommandExecutor.cs | 29 ++++++++++++++++++++++------- UI/App.xaml | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Logic/GitCommandExecutor.cs b/Logic/GitCommandExecutor.cs index 17197c6..69e3135 100644 --- a/Logic/GitCommandExecutor.cs +++ b/Logic/GitCommandExecutor.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.IO; @@ -15,13 +15,20 @@ public GitCommandExecutor(string repositoryPath) public string Execute(string command) { - var process = CreateProcess(command); - process.WaitForExit(10000); + string errorText; + try + { + var process = CreateProcess(command); + process.WaitForExit(10000); - if (process.ExitCode == 0) - return process.StandardOutput.ReadToEnd(); + if (process.ExitCode == 0) + return process.StandardOutput.ReadToEnd(); + errorText = process.StandardError.ReadToEnd(); + } catch (System.ComponentModel.Win32Exception) + { + errorText = "Could not locate git. Check it is installed and in your PATH settings"; + } - var errorText = process.StandardError.ReadToEnd(); throw new ApplicationException(errorText); } @@ -43,7 +50,15 @@ Process CreateProcess(string command) RedirectStandardOutput = true, RedirectStandardError = true }; - var process = Process.Start(startInfo); + Process process; + try + { + process = Process.Start(startInfo); + } catch (System.ComponentModel.Win32Exception e) + { + //should alert user that git couldn't be found + throw e; + } return process; } } diff --git a/UI/App.xaml b/UI/App.xaml index a1408a9..b363ea9 100644 --- a/UI/App.xaml +++ b/UI/App.xaml @@ -1,7 +1,7 @@ + Startup="Application_Startup"> From 2b331372de1f8fecf8f9106d1b7d7073101bc945 Mon Sep 17 00:00:00 2001 From: Richard Banks Date: Tue, 23 Jun 2020 19:26:42 +1000 Subject: [PATCH 4/6] Migration to .NET Core 3.1, with switch to GraphShape library --- .gitignore | 1 + Logic/CommitEdge.cs | 2 +- Logic/CommitGraph.cs | 2 +- Logic/GitCommandExecutor.cs | 9 +-------- Logic/Logic.csproj | 7 +++---- Logic/RepositoryWatcher.cs | 3 --- Logic/ViewModel.cs | 2 +- README.md | 6 +++--- Tests/Tests.csproj | 11 +++++++---- UI/App.xaml.cs | 6 ------ UI/CommitGraphLayout.cs | 4 ++-- UI/MainWindow.xaml | 4 ++-- UI/UI.csproj | 7 +++++-- 13 files changed, 27 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index dac58bc..e0f8e79 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ [Bb]in/ [Oo]bj/ .vs +.vscode # mstest test results TestResults diff --git a/Logic/CommitEdge.cs b/Logic/CommitEdge.cs index 4044de8..7ec51f9 100644 --- a/Logic/CommitEdge.cs +++ b/Logic/CommitEdge.cs @@ -1,4 +1,4 @@ -using QuickGraph; +using QuikGraph; namespace GitViz.Logic { diff --git a/Logic/CommitGraph.cs b/Logic/CommitGraph.cs index afa6b4d..ad63b12 100644 --- a/Logic/CommitGraph.cs +++ b/Logic/CommitGraph.cs @@ -1,4 +1,4 @@ -using QuickGraph; +using QuikGraph; namespace GitViz.Logic { diff --git a/Logic/GitCommandExecutor.cs b/Logic/GitCommandExecutor.cs index 69e3135..579d337 100644 --- a/Logic/GitCommandExecutor.cs +++ b/Logic/GitCommandExecutor.cs @@ -51,14 +51,7 @@ Process CreateProcess(string command) RedirectStandardError = true }; Process process; - try - { - process = Process.Start(startInfo); - } catch (System.ComponentModel.Win32Exception e) - { - //should alert user that git couldn't be found - throw e; - } + process = Process.Start(startInfo); return process; } } diff --git a/Logic/Logic.csproj b/Logic/Logic.csproj index 92ccc19..b710639 100644 --- a/Logic/Logic.csproj +++ b/Logic/Logic.csproj @@ -1,12 +1,11 @@  - netcoreapp3.0 + netstandard2.0 - - - + + \ No newline at end of file diff --git a/Logic/RepositoryWatcher.cs b/Logic/RepositoryWatcher.cs index a29d3a5..4865e2a 100644 --- a/Logic/RepositoryWatcher.cs +++ b/Logic/RepositoryWatcher.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Reactive.Linq; -using System.Threading; namespace GitViz.Logic { diff --git a/Logic/ViewModel.cs b/Logic/ViewModel.cs index 165473c..98dbd70 100644 --- a/Logic/ViewModel.cs +++ b/Logic/ViewModel.cs @@ -21,7 +21,7 @@ public string WindowTitle { get { - return "Readify GitViz (Alpha)" + return "Readify GitViz (Beta)" + (string.IsNullOrWhiteSpace(_repositoryPath) ? string.Empty : " - " + Path.GetFileName(_repositoryPath)); diff --git a/README.md b/README.md index a7deacc..f6ab2a0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ GitViz ### Type commands. See their effect in real time. Perfect rendering for presentations. -Among all things we do at [Readify](http://readify.net) to help people build better software, we teach a lot of teams about Git. +Among all things we do at Readify (now [Telstra Purple](https://purple.telstra.com)) to help people build better software, we teach a lot of teams about Git. For newbies, the concept of commit graphs, references, branches and merges can be a bit hard to visualize. @@ -19,7 +19,7 @@ Pre-built binaries are available at https://github.com/Readify/GitViz/releases ### Release Quality -__Alpha.__ This entire project so far consists of one Readify guy sitting down the back of a training course and tapping away for a few hours, no more. +__Beta.__ This was built by one guy sitting at the back of a training course and tapping away for a few hours, no more. Since then it's been well used and hasn't seen many issues, so we're calling it 'beta'. Will that ever change? ¯\_(ツ)_/¯ ### What is 'presentation quality'? @@ -31,7 +31,7 @@ This is not a day-to-day visualizing tool for big, active repositories. It's opt ### How it works -Shells out to `git.exe`, and then renders it with the excellent [GraphSharp](http://graphsharp.codeplex.com). +Shells out to `git.exe`, and then renders it with the excellent [GraphShape](https://github.com/KeRNeLith/GraphShape). ### FAQ #### How can I remove dangling commits? diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 23a6d50..01a3feb 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,14 +1,17 @@  - netcoreapp3.0 + netcoreapp3.1 false - - - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/UI/App.xaml.cs b/UI/App.xaml.cs index 2eba8db..a58b9a8 100644 --- a/UI/App.xaml.cs +++ b/UI/App.xaml.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; using System.Windows; namespace UI diff --git a/UI/CommitGraphLayout.cs b/UI/CommitGraphLayout.cs index 62ab56d..dba96b0 100644 --- a/UI/CommitGraphLayout.cs +++ b/UI/CommitGraphLayout.cs @@ -1,5 +1,5 @@ -using GitViz.Logic; -using GraphSharp.Controls; +using GitViz.Logic; +using GraphShape.Controls; namespace UI { diff --git a/UI/MainWindow.xaml b/UI/MainWindow.xaml index 1f43def..d70e62f 100644 --- a/UI/MainWindow.xaml +++ b/UI/MainWindow.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:logic="clr-namespace:GitViz.Logic;assembly=Logic" xmlns:ui="clr-namespace:UI" - xmlns:graphsharp="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls" + xmlns:graphsharp="clr-namespace:GraphShape.Controls;assembly=GraphShape.Controls" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="400" @@ -72,7 +72,7 @@ WinExe - netcoreapp3.0 + netcoreapp3.1 true readify.ico + win-x64 + true @@ -19,7 +21,8 @@ - + + From 1c04cce69b85c498505edacfb73c603b6e23ffc4 Mon Sep 17 00:00:00 2001 From: Richard Banks Date: Tue, 23 Jun 2020 19:39:25 +1000 Subject: [PATCH 5/6] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f18bb7..928108a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ GitViz ====== -> Psst, hey... are you looking for a .NET Core 3 version? Check out the `netcore` branch. Contributions and PRs on that branch are very welcome! +> GitViz now runs as a self-containeed .NET Core 3.1 application ### Type commands. See their effect in real time. Perfect rendering for presentations. From 40dfd820a810946465df1274a52faf5a37313179 Mon Sep 17 00:00:00 2001 From: Richard Banks Date: Wed, 24 Jun 2020 09:39:05 +1000 Subject: [PATCH 6/6] fix xaml namespace and readme.md typos --- README.md | 4 ++-- UI/MainWindow.xaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 928108a..7041026 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ GitViz ====== -> GitViz now runs as a self-containeed .NET Core 3.1 application +> GitViz is now available as a .NET Core 3.1 application ### Type commands. See their effect in real time. Perfect rendering for presentations. -Among all things we do at Readify (now [Telstra Purple](https://purple.telstra.com)) to help people build better software, we people about Git. +Among all things we do at Readify (now [Telstra Purple](https://purple.telstra.com)) to help people build better software, we teach people about Git. For newbies, the concept of commit graphs, references, branches and merges can be a bit hard to visualize. diff --git a/UI/MainWindow.xaml b/UI/MainWindow.xaml index d70e62f..617a161 100644 --- a/UI/MainWindow.xaml +++ b/UI/MainWindow.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:logic="clr-namespace:GitViz.Logic;assembly=Logic" xmlns:ui="clr-namespace:UI" - xmlns:graphsharp="clr-namespace:GraphShape.Controls;assembly=GraphShape.Controls" + xmlns:graphshape="clr-namespace:GraphShape.Controls;assembly=GraphShape.Controls" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="400" @@ -46,10 +46,10 @@ x:Key="VertexTemplateSelector" CommitTemplate="{StaticResource CommitTemplate}" ReferenceTemplate="{StaticResource ReferenceTemplate}" /> -