Diff Tools
Use Preferences -> Tools -> Diff Tools to configure tools for the Compare command.
Info
Note
Diff tools are (GUI) viewers of diff results. Diff tools are not related to the internal diff machinery of Git. If you want to customize the diff machinery itself, have a look at Git’s ‘diff.external’ config option.
SmartGit uses its built-in diff tool for text comparisons by default. You can configure external tools for particular file types.
Configuring entries
Use Add… or Copy… to create an entry. Use Edit… to change the selected entry or Remove to remove entries. Move Up and Move Down set the matching order; you can also drag entries.
In the entry dialog, File Pattern accepts comma-separated patterns with ? for one character and * for any number of characters.
Select one of these comparison types:
- Built-in file compare uses SmartGit’s editor for matching files.
- External diff tool passes both file versions to one invocation of an external tool.
- External viewer (invoked for both compared files) opens each version separately.
For an external tool or viewer, set Command to its executable and put its parameters in Arguments. Use the Variables menu to insert supported variables. The built-in comparison is used for text files when no entry matches.
Arguments for external tools
An External diff tool requires both ${leftFile} and ${rightFile} in its arguments.
The following variables are available:
${leftFile}represents the left (or usually “old”) version of the file${rightFile}represents the right (or usually “new”) version of the file${baseFile}represents the common base version of the file; depending on the context from which the diff tool is invoked, the common base is defined as:- the Index version, for a working-tree vs. Index comparison
- the HEAD version, for a working-tree vs. HEAD or a Index vs. HEAD comparison
- the version before the commit, for a single-commit comparison
- the merge base version of the two commits, when comparing two commits; this is similar to what SmartGit would display in case of conflicts
${leftEncoding},${rightEncoding}, and${baseEncoding}provide the corresponding text encodings.${leftTitle},${rightTitle}, and${baseTitle}provide titles for the file versions.
For certain files, like graphic files, there may be no appropriate left-right diff tool available. In this case you can configure an
External viewer which has only a single ${file} argument and which will be launched by SmartGit two times: once for the old and once for the new file.
Note
${leftLocalFile} and ${rightLocalFile} provide the corresponding paths in the working tree.
Use ${leftFile} and ${rightFile} for the actual versions being compared.
Comparison options
By default, the list is searched from top to bottom and the first matching tool is used. Enable Show chooser dialog if multiple entries match to choose between matching entries when comparing files.
Compare with working tree, even if all changes are staged uses the working-tree file for local comparisons when all changes are staged.
Otherwise, SmartGit compares the staged version against HEAD in that case.