Skip to content

Commit 0f6aae8

Browse files
GlennAWatsonEleniumglennawatson
authored andcommitted
Initial work on the rebase tool
1 parent 6d71c01 commit 0f6aae8

File tree

69 files changed

+5747
-18
lines changed

Some content is hidden

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

69 files changed

+5747
-18
lines changed

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

GitSquash.VisualStudio.Extension.sln

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitSquash.VisualStudio.Extension", "GitSquash.VisualStudio.Extension\GitSquash.VisualStudio.Extension\GitSquash.VisualStudio.Extension.csproj", "{D939BB9A-A531-42E3-AFED-081A2C296201}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamExplorer.Common", "TeamExplorer.Common\TeamExplorer.Common.csproj", "{388AC013-C628-4A32-ABBC-A28A68C3A112}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitSquash.VisualStudio", "GitSquash.VisualStudio.Extension\GitSquash.VisualStudio\GitSquash.VisualStudio.csproj", "{D6EE82CD-F83F-46D5-9A69-5941C519BE93}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RebaseWriter", "GitSquash.VisualStudio.Extension\RebaseWriter\RebaseWriter.csproj", "{EFD6C183-797C-4F3B-8C6B-7DDD482352AD}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommentWriter", "GitSquash.VisualStudio.Extension\CommentWriter\CommentWriter.csproj", "{8A822509-6B1D-4D04-B9E6-A5F80D8FFB8C}"
15+
EndProject
16+
Global
17+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
18+
Debug|Any CPU = Debug|Any CPU
19+
Release|Any CPU = Release|Any CPU
20+
VS2013|Any CPU = VS2013|Any CPU
21+
VS2015|Any CPU = VS2015|Any CPU
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{D939BB9A-A531-42E3-AFED-081A2C296201}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{D939BB9A-A531-42E3-AFED-081A2C296201}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{D939BB9A-A531-42E3-AFED-081A2C296201}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{D939BB9A-A531-42E3-AFED-081A2C296201}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{D939BB9A-A531-42E3-AFED-081A2C296201}.VS2013|Any CPU.ActiveCfg = Release|Any CPU
29+
{D939BB9A-A531-42E3-AFED-081A2C296201}.VS2013|Any CPU.Build.0 = Release|Any CPU
30+
{D939BB9A-A531-42E3-AFED-081A2C296201}.VS2015|Any CPU.ActiveCfg = Release|Any CPU
31+
{D939BB9A-A531-42E3-AFED-081A2C296201}.VS2015|Any CPU.Build.0 = Release|Any CPU
32+
{388AC013-C628-4A32-ABBC-A28A68C3A112}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{388AC013-C628-4A32-ABBC-A28A68C3A112}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{388AC013-C628-4A32-ABBC-A28A68C3A112}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{388AC013-C628-4A32-ABBC-A28A68C3A112}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{388AC013-C628-4A32-ABBC-A28A68C3A112}.VS2013|Any CPU.ActiveCfg = VS2013|Any CPU
37+
{388AC013-C628-4A32-ABBC-A28A68C3A112}.VS2013|Any CPU.Build.0 = VS2013|Any CPU
38+
{388AC013-C628-4A32-ABBC-A28A68C3A112}.VS2015|Any CPU.ActiveCfg = VS2015|Any CPU
39+
{388AC013-C628-4A32-ABBC-A28A68C3A112}.VS2015|Any CPU.Build.0 = VS2015|Any CPU
40+
{D6EE82CD-F83F-46D5-9A69-5941C519BE93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41+
{D6EE82CD-F83F-46D5-9A69-5941C519BE93}.Debug|Any CPU.Build.0 = Debug|Any CPU
42+
{D6EE82CD-F83F-46D5-9A69-5941C519BE93}.Release|Any CPU.ActiveCfg = Release|Any CPU
43+
{D6EE82CD-F83F-46D5-9A69-5941C519BE93}.Release|Any CPU.Build.0 = Release|Any CPU
44+
{D6EE82CD-F83F-46D5-9A69-5941C519BE93}.VS2013|Any CPU.ActiveCfg = Release|Any CPU
45+
{D6EE82CD-F83F-46D5-9A69-5941C519BE93}.VS2013|Any CPU.Build.0 = Release|Any CPU
46+
{D6EE82CD-F83F-46D5-9A69-5941C519BE93}.VS2015|Any CPU.ActiveCfg = Release|Any CPU
47+
{D6EE82CD-F83F-46D5-9A69-5941C519BE93}.VS2015|Any CPU.Build.0 = Release|Any CPU
48+
{EFD6C183-797C-4F3B-8C6B-7DDD482352AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49+
{EFD6C183-797C-4F3B-8C6B-7DDD482352AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{EFD6C183-797C-4F3B-8C6B-7DDD482352AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
51+
{EFD6C183-797C-4F3B-8C6B-7DDD482352AD}.Release|Any CPU.Build.0 = Release|Any CPU
52+
{EFD6C183-797C-4F3B-8C6B-7DDD482352AD}.VS2013|Any CPU.ActiveCfg = Release|Any CPU
53+
{EFD6C183-797C-4F3B-8C6B-7DDD482352AD}.VS2013|Any CPU.Build.0 = Release|Any CPU
54+
{EFD6C183-797C-4F3B-8C6B-7DDD482352AD}.VS2015|Any CPU.ActiveCfg = Release|Any CPU
55+
{EFD6C183-797C-4F3B-8C6B-7DDD482352AD}.VS2015|Any CPU.Build.0 = Release|Any CPU
56+
{8A822509-6B1D-4D04-B9E6-A5F80D8FFB8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57+
{8A822509-6B1D-4D04-B9E6-A5F80D8FFB8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
58+
{8A822509-6B1D-4D04-B9E6-A5F80D8FFB8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
59+
{8A822509-6B1D-4D04-B9E6-A5F80D8FFB8C}.Release|Any CPU.Build.0 = Release|Any CPU
60+
{8A822509-6B1D-4D04-B9E6-A5F80D8FFB8C}.VS2013|Any CPU.ActiveCfg = Release|Any CPU
61+
{8A822509-6B1D-4D04-B9E6-A5F80D8FFB8C}.VS2013|Any CPU.Build.0 = Release|Any CPU
62+
{8A822509-6B1D-4D04-B9E6-A5F80D8FFB8C}.VS2015|Any CPU.ActiveCfg = Release|Any CPU
63+
{8A822509-6B1D-4D04-B9E6-A5F80D8FFB8C}.VS2015|Any CPU.Build.0 = Release|Any CPU
64+
EndGlobalSection
65+
GlobalSection(SolutionProperties) = preSolution
66+
HideSolutionNode = FALSE
67+
EndGlobalSection
68+
EndGlobal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{8A822509-6B1D-4D04-B9E6-A5F80D8FFB8C}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>CommentWriter</RootNamespace>
11+
<AssemblyName>CommentWriter</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
<CodeAnalysisRuleSet>..\gitsquashruleset.ruleset</CodeAnalysisRuleSet>
26+
<RunCodeAnalysis>true</RunCodeAnalysis>
27+
<DocumentationFile>bin\Debug\CommentWriter.XML</DocumentationFile>
28+
</PropertyGroup>
29+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30+
<PlatformTarget>AnyCPU</PlatformTarget>
31+
<DebugType>pdbonly</DebugType>
32+
<Optimize>true</Optimize>
33+
<OutputPath>bin\Release\</OutputPath>
34+
<DefineConstants>TRACE</DefineConstants>
35+
<ErrorReport>prompt</ErrorReport>
36+
<WarningLevel>4</WarningLevel>
37+
<DocumentationFile>bin\Release\CommentWriter.XML</DocumentationFile>
38+
</PropertyGroup>
39+
<ItemGroup>
40+
<Reference Include="System" />
41+
<Reference Include="System.Core" />
42+
<Reference Include="System.Xml.Linq" />
43+
<Reference Include="System.Data.DataSetExtensions" />
44+
<Reference Include="Microsoft.CSharp" />
45+
<Reference Include="System.Data" />
46+
<Reference Include="System.Net.Http" />
47+
<Reference Include="System.Xml" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<Compile Include="Program.cs" />
51+
<Compile Include="Properties\AssemblyInfo.cs" />
52+
</ItemGroup>
53+
<ItemGroup>
54+
<None Include="App.config" />
55+
<None Include="packages.config" />
56+
</ItemGroup>
57+
<ItemGroup>
58+
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
59+
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
60+
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
61+
</ItemGroup>
62+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
63+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
64+
Other similar extension points exist, see Microsoft.Common.targets.
65+
<Target Name="BeforeBuild">
66+
</Target>
67+
<Target Name="AfterBuild">
68+
</Target>
69+
-->
70+
</Project>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
namespace CommentWriter
2+
{
3+
using System;
4+
using System.IO;
5+
6+
/// <summary>
7+
/// A program to write a appropriate comment for a rebase.
8+
/// </summary>
9+
public class Program
10+
{
11+
/// <summary>
12+
/// Executes the program.
13+
/// </summary>
14+
/// <param name="args">Arguments about the rebase.</param>
15+
public static void Main(string[] args)
16+
{
17+
if (args.Length != 1)
18+
{
19+
return;
20+
}
21+
22+
string fileName = args[0];
23+
24+
var tempCommentFileName = Environment.GetEnvironmentVariable("COMMENT_FILE_NAME");
25+
26+
if (string.IsNullOrWhiteSpace(tempCommentFileName))
27+
{
28+
return;
29+
}
30+
31+
string[] lines = File.ReadAllLines(tempCommentFileName);
32+
33+
using (var writer = new StreamWriter(fileName))
34+
{
35+
writer.NewLine = "\n";
36+
37+
foreach (string line in lines)
38+
{
39+
writer.WriteLine(line);
40+
}
41+
}
42+
}
43+
}
44+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("CommentWriter")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("CommentWriter")]
13+
[assembly: AssemblyCopyright("Copyright © 2016")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("8a822509-6b1d-4d04-b9e6-a5f80d8ffb8c")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net452" developmentDependency="true" />
4+
</packages>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=GitRebase_002EVisualStudio_002EExtension_002EAnnotations/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace GitSquash.VisualStudio.Extension.Converters
2+
{
3+
using System;
4+
using System.Globalization;
5+
using System.Windows;
6+
using System.Windows.Data;
7+
8+
/// <summary>
9+
/// Converter that will be visible only if all the boolean values passed are true.
10+
/// </summary>
11+
[ValueConversion(typeof(bool[]), typeof(Visibility))]
12+
public class AllTrueToVisibleConverter : IMultiValueConverter
13+
{
14+
/// <inheritdoc />
15+
public virtual object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
16+
{
17+
bool show = false;
18+
if (values == null || values.Length == 0)
19+
{
20+
return Visibility.Collapsed;
21+
}
22+
23+
show = true;
24+
foreach (object obj in values)
25+
{
26+
bool boolValue = false;
27+
if (obj is bool)
28+
{
29+
boolValue = (bool)obj;
30+
}
31+
32+
if (boolValue)
33+
{
34+
continue;
35+
}
36+
37+
show = false;
38+
break;
39+
}
40+
41+
return show ? Visibility.Visible : Visibility.Collapsed;
42+
}
43+
44+
/// <inheritdoc />
45+
public virtual object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
46+
{
47+
return new object[0];
48+
}
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
namespace GitSquash.VisualStudio.Extension.Converters
2+
{
3+
using System;
4+
using System.Globalization;
5+
using System.Windows;
6+
using System.Windows.Data;
7+
8+
/// <summary>
9+
/// Converter which will make controls visible if any of the boolean values are true.
10+
/// </summary>
11+
[ValueConversion(typeof(bool[]), typeof(Visibility))]
12+
public class AnyTrueToVisibleConverter : IMultiValueConverter
13+
{
14+
/// <inheritdoc />
15+
public virtual object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
16+
{
17+
bool show = false;
18+
if (values == null || values.Length == 0)
19+
{
20+
return Visibility.Collapsed;
21+
}
22+
23+
foreach (object obj in values)
24+
{
25+
if (!(obj is bool) || !(bool)obj)
26+
{
27+
continue;
28+
}
29+
30+
show = true;
31+
break;
32+
}
33+
34+
return show ? Visibility.Visible : Visibility.Collapsed;
35+
}
36+
37+
/// <inheritdoc />
38+
public virtual object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
39+
{
40+
return new object[0];
41+
}
42+
}
43+
}

0 commit comments

Comments
 (0)