Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: VerifyTests/DiffEngine
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 15.9.1
Choose a base ref
...
head repository: VerifyTests/DiffEngine
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 15.10.0
Choose a head ref
  • 18 commits
  • 9 files changed
  • 4 contributors

Commits on Feb 25, 2025

  1. refs and cleanup

    SimonCropp committed Feb 25, 2025
    Copy the full SHA
    6d170f2 View commit details

Commits on Feb 26, 2025

  1. refs and cleanup

    SimonCropp committed Feb 26, 2025
    Copy the full SHA
    0c13594 View commit details
  2. refs or cleanup

    SimonCropp committed Feb 26, 2025
    Copy the full SHA
    a513dc9 View commit details

Commits on Mar 3, 2025

  1. Bump Fody from 6.9.1 to 6.9.2 in /src (#606)

    Bumps [Fody](https://github.com/Fody/Fody) from 6.9.1 to 6.9.2.
    - [Release notes](https://github.com/Fody/Fody/releases)
    - [Commits](Fody/Fody@6.9.1...6.9.2)
    
    ---
    updated-dependencies:
    - dependency-name: Fody
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 3, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8ce85c9 View commit details
  2. Fix minimal typo in diff-tool.order.md (#607)

    bitbonk authored Mar 3, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    09e8571 View commit details
  3. Docs changes

    actions-user committed Mar 3, 2025
    Copy the full SHA
    dd078e3 View commit details
  4. Copy the full SHA
    99e3577 View commit details
  5. Merge branch 'main' of https://github.com/VerifyTests/DiffEngine

    SimonCropp committed Mar 3, 2025
    Copy the full SHA
    9dc97c8 View commit details
  6. Docs changes

    actions-user committed Mar 3, 2025
    Copy the full SHA
    9e729d9 View commit details

Commits on Mar 4, 2025

  1. Update MenuBuilder.cs

    SimonCropp committed Mar 4, 2025
    Copy the full SHA
    5e71ae1 View commit details
  2. Update WildcardFileFinder.cs

    SimonCropp committed Mar 4, 2025
    Copy the full SHA
    ef9ec42 View commit details

Commits on Mar 5, 2025

  1. Update GlobalUsings.cs

    SimonCropp committed Mar 5, 2025
    Copy the full SHA
    3a4bfe6 View commit details
  2. Bump ProjectDefaults from 1.0.147 to 1.0.148 in /src (#608)

    Bumps [ProjectDefaults](https://github.com/SimonCropp/ProjectDefaults) from 1.0.147 to 1.0.148.
    - [Commits](https://github.com/SimonCropp/ProjectDefaults/commits)
    
    ---
    updated-dependencies:
    - dependency-name: ProjectDefaults
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 5, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a7f38a0 View commit details
  3. refs and cleanup

    SimonCropp committed Mar 5, 2025
    Copy the full SHA
    4e0d81c View commit details

Commits on Mar 6, 2025

  1. expose "type of CI" in BuildServerDetector (#609)

    * expose "type of CI" in BuildServerDetector
    
    * Update BuildServerDetector.cs
    SimonCropp authored Mar 6, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    158f9a6 View commit details
  2. Copy the full SHA
    ab65805 View commit details
  3. Update OptionsFormLauncher.cs

    SimonCropp committed Mar 6, 2025
    Copy the full SHA
    83923c9 View commit details
  4. Update Directory.Build.props

    SimonCropp committed Mar 6, 2025
    Copy the full SHA
    8023907 View commit details
2 changes: 1 addition & 1 deletion docs/diff-tool.order.md
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ To change this file edit the source file and then run MarkdownSnippets.

### ViaEnvironment Variable

Set an `DiffEngine_ToolOrder` environment variable with the preferred order of toll resolution. The value can be comma (`,`), pipe (`|`), or space separated.
Set an `DiffEngine_ToolOrder` environment variable with the preferred order of tool resolution. The value can be comma (`,`), pipe (`|`), or space separated.

For example `VisualStudio,Meld` will result in VisualStudio then Meld then all other tools being the order.

2 changes: 1 addition & 1 deletion docs/mdsource/diff-tool.order.source.md
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ include: defaultOrder

### ViaEnvironment Variable

Set an `DiffEngine_ToolOrder` environment variable with the preferred order of toll resolution. The value can be comma (`,`), pipe (`|`), or space separated.
Set an `DiffEngine_ToolOrder` environment variable with the preferred order of tool resolution. The value can be comma (`,`), pipe (`|`), or space separated.

For example `VisualStudio,Meld` will result in VisualStudio then Meld then all other tools being the order.

126 changes: 70 additions & 56 deletions src/DiffEngine/BuildServerDetector.cs
Original file line number Diff line number Diff line change
@@ -6,83 +6,97 @@ public static class BuildServerDetector
{
static BuildServerDetector()
{
// Appveyor
// https://www.appveyor.com/docs/environment-variables/
// Travis
// https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
if (string.Equals(Environment.GetEnvironmentVariable("CI"), "true", StringComparison.OrdinalIgnoreCase))
{
Detected = true;
return;
}

var variables = Environment.GetEnvironmentVariables();
// Jenkins
// https://wiki.jenkins.io/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-belowJenkinsSetEnvironmentVariables
if (Environment.GetEnvironmentVariable("JENKINS_URL") != null)
{
Detected = true;
return;
}
IsJenkins = variables.Contains("JENKINS_URL");

// GitHub Action
// https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables
if (Environment.GetEnvironmentVariable("GITHUB_ACTION") != null)
{
Detected = true;
return;
}

// AzureDevops
// https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#agent-variables
// Variable name is 'Agent.Id' to detect if this is a Azure Pipelines agent.
// Note that variables are upper-cased and '.' is replaced with '_' on Azure Pipelines.
// https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#access-variables-through-the-environment
if (Environment.GetEnvironmentVariable("AGENT_ID") != null)
{
Detected = true;
return;
}
IsGithubAction = variables.Contains("GITHUB_ACTION");

// TeamCity
// https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html#PredefinedBuildParameters-ServerBuildProperties
if (Environment.GetEnvironmentVariable("TEAMCITY_VERSION") != null)
{
Detected = true;
return;
}
IsTeamCity = variables.Contains("TEAMCITY_VERSION");

// MyGet
// https://docs.myget.org/docs/reference/build-services#Available_Environment_Variables
if (string.Equals(Environment.GetEnvironmentVariable("BuildRunner"), "MyGet", StringComparison.OrdinalIgnoreCase))
{
Detected = true;
return;
}
IsMyGet = ValueEquals(variables, "BuildRunner", "MyGet");

// GitLab
// https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
if (Environment.GetEnvironmentVariable("GITLAB_CI") != null)
{
Detected = true;
return;
}
IsGitLab = variables.Contains("GITLAB_CI");

// GoDC
// https://docs.gocd.org/current/faq/dev_use_current_revision_in_build.html
IsGoDc = variables.Contains("GO_SERVER_URL");

// Travis
// https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
IsTravis = variables.Contains("TRAVIS_BUILD_ID");

// Docker
// https://www.hanselman.com/blog/detecting-that-a-net-core-app-is-running-in-a-docker-container-and-skippablefacts-in-xunit
if (Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") == "true")
{
Detected = true;
return;
}
IsDocker = ValueEquals(variables, "DOTNET_RUNNING_IN_CONTAINER", "true");

// GoDC
// https://docs.gocd.org/current/faq/dev_use_current_revision_in_build.html
if (Environment.GetEnvironmentVariable("GO_SERVER_URL") != null)
// AppVeyor
// https://www.appveyor.com/docs/environment-variables/
IsAppVeyor = variables.Contains("APPVEYOR");

IsWsl = variables.Contains("WSLENV");

// AzureDevops
// https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#agent-variables
// Variable name is 'Agent.Id' to detect if this is a Azure Pipelines agent.
// Note that variables are upper-cased and '.' is replaced with '_' on Azure Pipelines.
// https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#access-variables-through-the-environment
IsAzureDevops = ValueEquals(variables, "TF_BUILD", "True");

Detected = IsTravis ||
IsJenkins ||
IsGithubAction ||
IsAzureDevops ||
IsTeamCity ||
IsGitLab ||
IsMyGet ||
IsGoDc ||
IsDocker ||
IsWsl ||
IsAppVeyor;
}

static bool ValueEquals(IDictionary variables, string key, string value)
{
var variable = variables[key];
if(variable == null)
{
Detected = true;
return;
return false;
}

return string.Equals((string)variable, value, StringComparison.OrdinalIgnoreCase);
}

public static bool IsWsl { get; }

public static bool IsAppVeyor { get; }

public static bool IsTravis { get; }

public static bool IsDocker { get; }

public static bool IsAzureDevops { get; }

public static bool IsGitLab { get; }

public static bool IsGoDc { get; }

public static bool IsMyGet { get; }

public static bool IsTeamCity { get; }

public static bool IsGithubAction { get; }

public static bool IsJenkins { get; }

public static bool Detected { get; set; }
}
2 changes: 1 addition & 1 deletion src/DiffEngine/WildcardFileFinder.cs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
Path.AltDirectorySeparatorChar
];

static IEnumerable<string> EnumerateDirectories(string directory)
static List<string> EnumerateDirectories(string directory)
{
var expanded = Environment.ExpandEnvironmentVariables(directory);
if (!directory.Contains('*'))
4 changes: 1 addition & 3 deletions src/DiffEngineTray/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
// Global using directives

global using System.ComponentModel;
global using System.ComponentModel;
global using Microsoft.Win32.SafeHandles;
6 changes: 3 additions & 3 deletions src/DiffEngineTray/MenuBuilder.cs
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ public static ContextMenuStrip Build(Action exit, Action launchOptions, Tracker
return menu;
}

static IEnumerable<ToolStripItem> NonDefaultMenus(ToolStripItemCollection items) =>
static List<ToolStripItem> NonDefaultMenus(ToolStripItemCollection items) =>
items
.Cast<ToolStripItem>()
.Where(_ => _.Text != "Exit" &&
@@ -162,7 +162,7 @@ static IEnumerable<ToolStripItem> BuildMovesAndDeletes(
yield return new ToolStripSeparator();
}

static ToolStripItem BuildDelete(TrackedDelete delete, Action accept)
static ToolStripDropDownButton BuildDelete(TrackedDelete delete, Action accept)
{
var menu = new ToolStripDropDownButton($"{delete.Name}")
{
@@ -173,7 +173,7 @@ static ToolStripItem BuildDelete(TrackedDelete delete, Action accept)
return menu;
}

static ToolStripItem BuildMove(TrackedMove move, Action accept, Action discard)
static ToolStripDropDownButton BuildMove(TrackedMove move, Action accept, Action discard)
{
var tempName = Path.GetFileNameWithoutExtension(move.Temp);
var targetName = Path.GetFileNameWithoutExtension(move.Target);
2 changes: 1 addition & 1 deletion src/DiffEngineTray/Settings/OptionsFormLauncher.cs
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ static async Task<IReadOnlyCollection<string>> Save(KeyRegister keyRegister, Tra
}

await SettingsHelper.Write(settings);
return Array.Empty<string>();
return [];
}

static void AddHotKey(KeyRegister keyRegister, HotKey? hotKey, int id, Action action, List<string> saveErrors)
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<NoWarn>CS1591;CS0649</NoWarn>
<Version>15.9.1</Version>
<Version>15.10.0</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
<PackageTags>Testing, Snapshot, Diff, Compare</PackageTags>
<Description>Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.</Description>
8 changes: 4 additions & 4 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -7,11 +7,11 @@
<PackageVersion Include="Argon" Version="0.26.0" />
<PackageVersion Include="Caseless.Fody" Version="1.9.1" />
<PackageVersion Include="EmptyFiles" Version="8.7.1" />
<PackageVersion Include="Fody" Version="6.9.1" />
<PackageVersion Include="Fody" Version="6.9.2" />
<PackageVersion Include="MarkdownSnippets.MsBuild" Version="27.0.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageVersion Include="Polyfill" Version="7.18.0" />
<PackageVersion Include="ProjectDefaults" Version="1.0.147" />
<PackageVersion Include="Polyfill" Version="7.21.0" />
<PackageVersion Include="ProjectDefaults" Version="1.0.148" />
<PackageVersion Include="Resourcer.Fody" Version="1.8.1" />
<PackageVersion Include="Serilog" Version="4.2.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="6.0.0" />
@@ -25,7 +25,7 @@
<PackageVersion Include="Verify.DiffPlex" Version="3.1.2" />
<PackageVersion Include="Verify.ImageMagick" Version="3.6.0" />
<PackageVersion Include="Verify.WinForms" Version="4.0.0" />
<PackageVersion Include="Verify.Xunit" Version="28.12.0" />
<PackageVersion Include="Verify.Xunit" Version="28.13.0" />
<PackageVersion Include="Xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
<PackageVersion Include="XunitContext" Version="3.3.2" />