Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
[Bb]in/
[Oo]bj/
.vs
.vscode

# mstest test results
TestResults
Expand Down
2 changes: 1 addition & 1 deletion Logic/CommitEdge.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using QuickGraph;
using QuikGraph;

namespace GitViz.Logic
{
Expand Down
2 changes: 1 addition & 1 deletion Logic/CommitGraph.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using QuickGraph;
using QuikGraph;

namespace GitViz.Logic
{
Expand Down
22 changes: 15 additions & 7 deletions Logic/GitCommandExecutor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.IO;

Expand All @@ -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);
}

Expand All @@ -43,7 +50,8 @@ Process CreateProcess(string command)
RedirectStandardOutput = true,
RedirectStandardError = true
};
var process = Process.Start(startInfo);
Process process;
process = Process.Start(startInfo);
return process;
}
}
Expand Down
2 changes: 2 additions & 0 deletions Logic/InternalVisibleForTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Tests")]
101 changes: 6 additions & 95 deletions Logic/Logic.csproj
Original file line number Diff line number Diff line change
@@ -1,100 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BF9333A3-490D-4C93-9F41-11016C9B324C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GitViz.Logic</RootNamespace>
<AssemblyName>GitViz.Logic</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="GraphSharp">
<HintPath>..\packages\GraphSharp.1.1.0.0\lib\net40\GraphSharp.dll</HintPath>
</Reference>
<Reference Include="GraphSharp.Controls">
<HintPath>..\packages\GraphSharp.1.1.0.0\lib\net40\GraphSharp.Controls.dll</HintPath>
</Reference>
<Reference Include="QuickGraph">
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.dll</HintPath>
</Reference>
<Reference Include="QuickGraph.Data">
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Data.dll</HintPath>
</Reference>
<Reference Include="QuickGraph.Graphviz">
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Graphviz.dll</HintPath>
</Reference>
<Reference Include="QuickGraph.Serialization">
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Serialization.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Reactive.Core">
<HintPath>..\packages\Rx-Core.2.1.30214.0\lib\Net45\System.Reactive.Core.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Interfaces">
<HintPath>..\packages\Rx-Interfaces.2.1.30214.0\lib\Net45\System.Reactive.Interfaces.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Linq">
<HintPath>..\packages\Rx-Linq.2.1.30214.0\lib\Net45\System.Reactive.Linq.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.PlatformServices">
<HintPath>..\packages\Rx-PlatformServices.2.1.30214.0\lib\Net45\System.Reactive.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WPFExtensions">
<HintPath>..\packages\WPFExtensions.1.0.0\lib\WPFExtensions.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Commit.cs" />
<Compile Include="CommitEdge.cs" />
<Compile Include="CommitGraph.cs" />
<Compile Include="FsckParser.cs" />
<Compile Include="GitCommandExecutor.cs" />
<Compile Include="LogParser.cs" />
<Compile Include="LogRetriever.cs" />
<Compile Include="Properties\Annotations.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Reference.cs" />
<Compile Include="RepositoryWatcher.cs" />
<Compile Include="Vertex.cs" />
<Compile Include="ViewModel.cs" />
</ItemGroup>

<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="QuikGraph" Version="2.2.0" />
<PackageReference Include="System.Reactive.Core" Version="4.4.1" />
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
38 changes: 0 additions & 38 deletions Logic/Properties/AssemblyInfo.cs

This file was deleted.

3 changes: 0 additions & 3 deletions Logic/RepositoryWatcher.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion Logic/ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public string WindowTitle
{
get
{
return "Readify GitViz (Alpha)"
return "Readify GitViz (Beta)"
+ (string.IsNullOrWhiteSpace(_repositoryPath)
? string.Empty
: " - " + Path.GetFileName(_repositoryPath));
Expand Down
11 changes: 0 additions & 11 deletions Logic/packages.config

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
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 is now available as a .NET Core 3.1 application

### Type commands. See their effect in real time. Perfect rendering for presentations.

Among the many things we do at [Readify](http://readify.net) to help people build better software, we teach 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.

Expand All @@ -23,7 +23,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'?

Expand All @@ -35,7 +35,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?
Expand Down
14 changes: 7 additions & 7 deletions Tests/LogParserTests/ParseCommit.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GitViz.Logic;
using GitViz.Logic;
using NUnit.Framework;

namespace GitViz.Tests.LogParserTests
Expand All @@ -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);
Expand Down
13 changes: 8 additions & 5 deletions Tests/LogRetrieverTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using GitViz.Logic;
using NUnit.Framework;

Expand Down Expand Up @@ -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);
}
Expand All @@ -57,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);
}
}

Expand All @@ -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);
}
Expand Down
36 changes: 0 additions & 36 deletions Tests/Properties/AssemblyInfo.cs

This file was deleted.

Loading