Configuring Git Client to Compare TestStand Sequence Files

Updated Jan 8, 2025

Environment

Software

  • TestStand

When using a Git client, like Microsoft Visual Studio or SourceTree, the Git clients, with their default configurations, would not be able to compare changes in TestStand sequence files, when the TestStand sequence files are stored in binary format.

To enable the sequence files comparison, user need to store TestStand sequence files in XML format which would then enable Git clients to compare changes in TestStand sequence files with Git clients using text comparison available within the Git clients. However, storing TestStand sequence files in XML format will result in large file size and difficulty in merging changes while still maintaining the validity of XML and the sequence file. 

 

The TestStand File Diff and Merge utility can compare and merge changes between TestStand sequence files. This utility can be used to compare and merge changes of TestStand sequence files in Git repositories too. The following section depict how the TestStand File Diff and Merge utility can be configured with some Git clients to launch the TestStand File Diff and Merge utility in order to compare and/or merge changes in TestStand sequence files.

 

Configuring External Tools in Git 

It is possible to configure external tools for diff and merge for Git through the Git configuration files in the system. The below Git clients make use of these settings and launch the external tool defined in Git configuration files to compare and/or merge changes.

Git ClientConfiguration LevelDefault Level in Tool
Microsoft Visual Studio
  • Repository
  • Client
  • Global
Client
Atlassian SourceTree
  • Repository
  • Client
  • Global
Client
Git Cola
  • Repository
  • Global
Global
GitKraken
  • Repository
  • Global
Global
  • Configuring at a repository level would only apply the changes to that Git repository.

     

  • Configuring at a client level would apply to that Git client and any Git repository accessed through that Git client.

     

  • Configuring at a global level would apply to all Git clients and all Git repositories

     

  • Default level in tool is used when the Config JSON file provided as tool argument does not exist.

 

Note: Sourcetree can also be configured manually in the client itself as specified later in this document.

 

To be able to compare and merge TestStand sequence files when working on a Git repository, it is possible to make the required updates to the Git configuration files at the appropriate level, supported for a given Git client, to define the TestStand File Diff and Merge utility as the external diff and merge tool in Git for TestStand sequence files.

 

The attached tool would provide the necessary configuration for any of the above-mentioned Git clients at the supported level. Use this tool to make the required configuration updates in your system by following the steps below.

Prerequisites

  • TestStand is installed and the Tools component was selected at the time of installation.

Note: If the Tools component was not installed, you can install the same by repairing TestStand through NI Package Manager, additionally select the Tools component and complete the repair.

Step 1. Download the attached zip file.

Step 2. Extract the contents to a desired folder (e.g. C:\ExtractedFolder)

Step 3. For the Git client you intend to configure, you can follow one of the below options:

a. Provide the argument to the tool as the Git client Config JSON file without creating it to let the tool configure the intended Git client at its default level.

b. Create a Config JSON, <GitClient>_Config.json, with the contents as defined in section Config JSON File.

Step 4. Open a command prompt window with administrator privileges.

Step 5. Navigate to the extracted folder mentioned in Step 2.

Step 6. In the command prompt window, execute the application “ConfigurationModifier.exe” providing the config JSON file for the desired Git client as the argument.

 

E.g. the following command will configure Microsoft Visual Studio: C:\ExtractedFolder>ConfigurationModifier.exe VisualStudio_Config.json.

 

Refer to Command-line usage for details of arguments for the application.

Step 7. If no errors are encountered, TestStand File Diff and Merge utility would be configured as the Git external tool for diff and merge for the Git client you chose.

 

Note: A log file “ConfigurationModifierLog.log” gets created containing the execution log of the tool at the same location as “ConfigurationModifier.exe”.

 

Command-line usage

The following command-line arguments are supported by “ConfigurationModifier.exe”:

ArgumentDescription
?Describe the usage details for the application
helpDescribe the usage details for the application.
<GitClient>_Config.json

Configure Git external tool for the Git client <GitClient>.

Note: If this file is not present, the tool will create one with the latest version of the Git client available in the system and configure it as per the default level mentioned in the above table.

 

Config JSON File

Configuration details are provided to the “ConfigurationModifier.exe” application through the <GitClient>_Config.json file as an argument. The name and contents of this JSON file varies depending on the Git client being configured. The following table provides the details of the valid data that should be present in the Config JSON file for a given Git client.

<GitClient>JSON content exampleDescription
VisualStudio

{

"MSVisualStudioClients": [

{

"ClientName": "Visual Studio Professional 2022", "ClientPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\Common7\\IDE\\devenv.exe", "Version": "17.12.0"

}

],

"ConfigurationLevel": "repo",

"RepositoryPaths": [

"C:\\GitRepos\Repo1",

"C:\\GitRepos\Repo2",

"C:\\GitRepos\Repo3"

]

}

An object consisting of: 

  • array of “MSVisualStudioClients”, where each element consists of 
    • “ClientName” as the Visual Studio version name.
    • “ClientPath” as the path to Visual Studio application.
    •  “Version” as the version of Visual Studio.
  • “ConfigurationLevel” as one of {“repo”, “client”, “global”}
  • “RepositoryPaths” as an array of folder paths. This is required only if the “ConfigurationLevel” is set to “repo”, else set it as ‘null’
Sourcetree

{

" SourceTreeClients": [

{

"ClientName": "SourceTree",

"ClientPath": "C:\\Users\\Administrator\\ AppData\\Local\\SourceTree\\SourceTree.exe",

"Version": "3.4.19"

}

],

" ConfigurationLevel ": "client",

" RepositoryPaths ": null

An object consisting of:

  • array of “SourceTreeClients”, where each element consists of
    • “ClientName” as the SourceTree version name.
    • “ClientPath” as the path to SourceTree application.
    • “Version” as the version of SourceTree.
  • “ConfigurationLevel” as one of {“repo”, “client”, “global”}
  • “RepositoryPaths” as an array of folder paths. This is required only if the “ConfigurationLevel” is set to “repo”, else set it as ‘null’.
GitKraken

{ " GitKrakenClients": [

 {

"ClientName": "GitKraken",

"ClientPath": "C:\\Users\\Administrator\\ AppData\\Local\\gitkraken\\gitkraken.exe", "Version": "10.5.0"

}

], " ConfigurationLevel ": "global" } 

An object consisting of:

  • array of “GitKrakenClients”, where each element consists of
    • “ClientName” as the Git Kraken version name.
    • “ClientPath” as the path to Git Kraken application.
    • “Version” as the version of Git Kraken.
  • “ConfigurationLevel” as “global”. 
GitCola

{

" GitColaClients": [

{

"ClientName": "git-cola",

"ClientPath": "C:\\Users\\Administrator\\ AppData\\Local\\Programs\\git-cola",

"Version": "4.8.2"

}

],

"ConfigurationLevel": "repo",

"RepositoryPaths": [

"C:\\GitRepos\Repo1",

"C:\\GitRepos\Repo2",

"C:\\GitRepos\Repo3"

]

An object consisting of:

  • array of “GitColaClients”, where each element consists of
    • “ClientName” as the Git Cola version name.
    • “ClientPath” as the path to Git Cola application. 
    • “Version” as the version of Git Cola. 
  • “ConfigurationLevel” as one of {“repo”, “global”}
  • “RepositoryPaths” as an array of folder paths. This is required only if the “ConfigurationLevel” is set to “repo”, else set it as ‘null’. 

 

Tortoise Git

Tortoise Git provides settings to configure an external application to compare and merge files. Perform the following steps to configure TestStand File Diff and Merge utility to compare and merge TestStand sequence files.

Steps to follow

Prerequisites:

TestStand is installed and the Tools component was selected at the time of installation.

Note: If the Tools component was not installed, you can install the same by repairing TestStand through NI Package Manager, additionally select the Tools component and complete the repair.

1. Launch Settings dialog for Tortoise Git.

2. Configure an external tool to compare/merge TestStand sequence files using one of the following:

a. Using custom File Launcher tool attached in this KB as an external program:

i. Download the attached zip file and extract the contents to a desired folder (e.g. C:\ExtractedFolder).

ii. Copy the following files to ‘C:\Users\Public\Documents\National Instruments\GitExternalToolLauncher’

FileLauncher.*

fileExtensionToApplicationMapping.json

defaultGitClient.json

iii. For configuring Diff tool, click on Diff Viewer node and to configure Merge tool, click on Merge Tool node.

iv. Select the External option.

v. Click on the brows button (…) and select the file C:\Users\Public\Documents\National Instruments\GitExternalToolLauncher\FileLauncher.exe

vi. Provide the arguments to the external program as specified in Step 3.

b. Using diff/merge advanced settings for file extension based configuration:

i. For configuring Diff tool, click on Diff Viewer node and to configure Merge tool, click on Merge Tool node.

ii. Click on the Advanced… button to launch the Advanced settings dialog for diff or merge tool.

iii. Add a new entry for TestStand sequence files by clicking on the Add… button to launch the Edit extension specific program dialog.

iv. Enter ‘.seq’ for Extension and ‘C:\Program Files (x86)\National Instruments\Shared\TestStand\FileDifferLauncher.exe’ as the External Program.

v. Provide the arguments to the external program as specified in Step 3.

3. Provide the arguments to external program as:

for Diff: %mine %base

for Merge: %base %mine %theirs %merged

4. Click OK through the opened dialogs to complete setting custom external tools for Diff and Merge.

For details on Tortoise Git settings to configure external diff and merge tools, refer to https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-progs

 

Atlassian Sourcetree

SourceTree provides option to configure custom external application as a tool to compare and merge files correspondingly. Perform the following steps to configure TestStand File Diff and Merge utility to compare and merge TestStand sequence files.

Steps to follow

Prerequisites:

TestStand is installed and the Tools component was selected at the time of installation.

Note: If the Tools component was not installed, you can install the same by repairing TestStand through NI Package Manager, additionally select the Tools component and complete the repair.

1. In Sourcetree, under the Tools menu, click on the Options menu item to open the Options dialog.

2. Click on the Diff tab to access the External Diff / Merge settings

3. From the drop down list, select Custom for External Diff Tool and Merge Tool.

4. Configure an external tool to compare/merge TestStand sequence files using one of the following:

a. Using TestStand File Diff and Merge Utility directly:

i. For the Diff and Merge Command fields, click on the brows button (…) and select the file C:\Program Files (x86)\National Instruments\Shared\TestStand\FileDifferLauncher.exe

b. Using the custom File Launcher tool attached in this KB:

i. Download the attached zip file and extract the contents to a desired folder (e.g. ‘C:\ExtractedFolder’).

ii. Copy the following files to ‘C:\Users\Public\Documents\National Instruments\GitExternalToolLauncher’

FileLauncher.*

fileExtensionToApplicationMapping.json

defaultGitClient.json

iii. For the Diff and Merge Command fields, click on the brows button (…) and select the file C:\Users\Public\Documents\National Instruments\GitExternalToolLauncher\FileLauncher.exe

5. Provide the arguments as:

for Diff: \"$LOCAL\" \"$REMOTE\"

for Merge: \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"

6. Click OK to complete setting custom external tools for Diff and Merge.

1Git Kraken requires Git to be installed in the system for configuring Git Kraken to use external Diff and Merge tool globally. 

Next Steps

Adding new file extension mapping

User can extend this tool to map other file types and the application of their choice. To do this, update the file 'fileExtensionToApplicationMapping.json' under ‘C:\Users\Public\Documents\National Instruments\GitExternalToolLauncher’ folder to add newer mapping for file extension and the application path to the application to use for the specified file extension.

This JSON file contains an array of value pairs, <FileExtension, ApplicationPath>.

 

To know more about the TestStand File Diff and Merge tool refer to the link attached.