The Changes View
The Changes View is available on all 3 SmartGit Main Windows, showing the changes made to the file selected in the Files View.
The layout of the Changes View depends on whether the selected file has been staged or not:
- When an unstaged file is selected in the Files View, the Changes View shows the difference between the Working Tree and Index.
- When a staged file is selected in the Files View, the Changes View shows the difference between the Index and the HEAD commit in the repository.
Use the << and >> arrow buttons to move changed Hunks between panes, or use the x button to revert the Hunk.
To apply a deletion in Side by Side mode, place the caret next to the deletion boundary in the pane where the Hunk is absent. Use the apply-block keyboard shortcut shown in that pane’s context menu.
Small arrows at the left or right edge of a text pane indicate changes outside the visible width.
Use Find in a text pane to search its contents; the Compare Editor explains the search options.
Note
- If you need to stage only specific lines within a Hunk, use the Index Editor.
- You can’t move staged changes directly into HEAD, as that will require a new commit.
- The Changes View has only 2 panes, and as a result, the HEAD (repository) file version does NOT appear in the Changes View unless the file has been staged. To view the 3 panes at once, please use the Index Editor.
- Changes View won’t automatically compare files larger than the configured
changes.maximumFileSizelow-level setting. If you attempt to compare a file larger than this setting, SmartGit will warn that the ‘File size exceeds the configured limit’. Clicking Force Compare will override the limit temporarily for this file, and perform the comparison. The value can be changed more permanently in the Low Level Properties preferences.
Inner-line comparison
The default Syntax-dependent mode uses the file’s language to match identifiers, strings, and other syntax elements within changed lines. To change the mode, choose Settings… from the Changes View hamburger menu and open the Compare tab. Under Inner-Line Comparison, you can also choose Alphanumeric words, Character-based, Java identifiers, C identifiers, or Off.
On the same tab, Refine change blocks is enabled by default. With a word or character comparison mode, it can separate added or removed lines from a neighboring edit into their own hunks.
Moved lines
The Detect Moves option in the Changes View hamburger menu highlights blocks moved within or between files. It is enabled by default in both Unified and Side by Side modes. SmartGit also highlights edits made within a detected move.
In the Standard Window and Log Window, moves between files are supported for commit comparisons and for staged or unstaged changes. In the Working Tree Window, they are supported for HEAD versus Index and Index versus Working Tree.
In Side by Side mode, an up or down arrow marks a move within the file. A diagonal arrow marks a move to or from another file. Hover over an arrow to compare the block with its counterpart in the opposite pane. For moves between files, the preview shows the other file’s path. Click the arrow to pin the preview for scrolling. Click it again to restore the normal comparison and its apply/revert buttons.
With the caret in a moved block in Side by Side mode:
- Show Opposite Move Block (
O) shows or hides the preview. - Pin/Unpin Move Overlay (
P) pins or closes the preview.
To stage or revert a complete move, apply the removed and added hunks at both locations. Added and removed files show move markers without ordinary hunk controls. Use the file-level commands for these files.
A warning icon on the Changes View toolbar means that cross-file moves could not be fully checked. Hover over it for the reason.
Note
Move detection uses similarity and size limits, so some moves may remain unmarked.
Further matches can appear after the initial comparison while detection continues in the background.
Commit comparisons search other modified, renamed, added, and removed files.
The move-detection properties control the initial wait and the base similarity threshold for moves within a file.
Set the low-level property changes.moveDetection.minimumMoveTokenCount to a positive token count to suppress small move matches within a file.
The default, 0, adds no token-count restriction.
For moves between files, changes.moveDetection.minimumRelatedMoveSimilarity sets the base similarity threshold (default 70 percent).
changes.moveDetection.minimumRelatedMoveTokenCount sets the minimum token count (default 16).
Move detection uses the filename rules on the Languages tab in Preferences to choose a syntax language for each file.
The language selected in the Changes View hamburger menu controls display highlighting.
These additional low-level properties limit cross-file move detection:
changes.moveDetection.maximumRelatedFileCount: skip cross-file analysis when the number of related files reaches this limit (default128).changes.moveDetection.maximumRelatedFileTokens: maximum tokens per file side (default1000000). The effective limit is also capped bycompare.innerlineMaxTokens(default1000000).changes.moveDetection.maximumRelatedInputWeight: maximum estimated memory for prepared related files (default67108864bytes, or 64 MiB). Files that exceed size limits or cannot be read are skipped individually. Other detected moves remain visible.changes.moveDetection.maximumCacheWeightlimits the estimated memory for related-file comparisons cached within the current comparison (default33554432bytes, or 32 MiB). Set it to0to disable this cache.
Images
Unified is the default for images with matching pixel dimensions, and for added or removed images. It offers two ways to compare images on one canvas:
- Wipe compares the images across a movable separator and is the default.
- Blend overlays the images with adjustable opacity.
Use the vertical slider or the mouse wheel over the image to move the separator or adjust the blend.
Hold Ctrl (Command on macOS) while scrolling to adjust zoom.
Changing files resets the wipe position by default. Clear Reset for other file in the slider’s context menu to keep the position. The blend opacity and Wipe/Blend choice are remembered.
Choose Side by Side to show the images in separate panes. Images with different pixel dimensions always use this layout. SmartGit remembers the image layout separately from the text layout.
When comparing images, transparent areas are shown over a checkerboard background.
Use the low-level property imageViewer.checkerBoard.size to change the checkerboard cell size.
The default is 2, and the minimum is 1.
Note
Side by Side keeps the zoom when you switch files.
Set imageViewer.resetZoomForDifferentFile to true to reset it when selecting another image.
Choosing the Comparison in the Working Tree Window
In the Working Tree Window, the Changes View hamburger menu offers comparisons between HEAD and Index, or between Index and Working Tree. With a combined file list, Automatic chooses the comparison based on the selected file’s staged and unstaged changes.
Switching layouts with View | Separate Working Tree and Index enables Automatic for a combined list and disables it for separate lists. With separate lists, the selected list determines the comparison.
Additional Features in Changes View When Integrations Are Enabled
(Log Window only)
In the Log Window only, when the Virtual Merge Commit (diamond icon) has been selected in the Graph View:
- The Changes View will allow you to view, and add comments on the Pull Request.
- Comments on the PR can be viewed and selected on the Comments tab of the Files View.
See Pull Requests for details.
Customizing the Layout of the Changes View
There are several options to customize the layout of the Changes View:
- Select between Unified and Side by Side mode to view the Index and Working Tree versions either as separate panes, or as a unified change.
- Compact mode hides sections of the file which are unchanged.
- Word-Wrap wraps long lines to the pane width in both Unified and Side by Side modes.
Use the toggle on the Changes View toolbar or in its hamburger menu.
It is off by default.
For large comparisons, SmartGit temporarily turns wrapping off without changing your saved preference.
Smaller comparisons use your saved choice again.
In Side by Side mode, wrapped continuation rows are indented and marked with a curved arrow.
Use the low-level property
changesView.wordWrap.indentWrappedLinesto disable this indentation. Continuation arrows then appear in the line-number gutter. - Ignore WS hides formatting whitespace changes. With Syntax-dependent comparison, whitespace inside strings remains significant. Added or removed blank lines remain changes.
- Use the Up and Down arrows to move to the previous, and next hunk of changes, respectively.
The default shortcuts for Previous Change (
Shift+F6) and Next Change (F6) also work while a text pane has focus. - Additionally, the hamburger icon at the top right provides further customization:
- Ignore Case Change for Line Comparison hides case-only differences, including within changed lines.
- Ignore Line-Ending Changes hides differences between line-ending styles such as
LFandCRLF. Adding or removing the final newline remains a change. - Changing the Syntax Highlighting language.
- Further settings, such as tab sizing and whitespace visualization.
By default, navigating to an insertion or deletion moves focus to the pane containing the changed text.
To keep the current pane focused, set the low-level property compare.gotoZeroSizeBlockChangeSide to false.
Note
Use the low-level property changes.wordWrap.lineCountLimit to change the wrapping limit (default 1000).
SmartGit turns wrapping off when either file or the unified result reaches this number of lines.
Note
SmartGit may omit detailed highlighting within a changed block if the comparison requires too much work. The inner-line comparison properties set these limits.
Note
Set the low-level property changes.showRefineBlocksButton to true to add Refine next to Ignore WS on the toolbar.
compare.blockCoalescing controls whether change blocks separated only by whitespace are joined (default true).
Related Low-Level Properties
compare.innerlineMaxComputationSteps
This sets the work limit for finding detailed changes within a pair of changed blocks.
The default is 10000000, and the maximum is 100000000.
Increasing it can make comparisons slower.
compare.innerlineSearchDistanceThreshold
For large change blocks, this limits the search distance as a percentage of the combined token count retained for comparison on both sides.
Tokens without a possible match have already been discarded from that count.
The default is 20.
Set it to 100 to disable this additional limit; the computation step limit still applies.
compare.innerlineSearchDistanceThresholdMinTokens
This sets the minimum combined retained token count at which the search-distance limit applies.
The default is 10000.
Note
These limits affect detailed highlighting within changed blocks. Restart SmartGit after changing them.
changes.moveDetection.initialWaitMillis
This sets how long to wait for move detection before displaying the best result available so far.
The default is 100 milliseconds.
Remaining detection continues in the background and can refine the display.
changes.moveDetection.minimumMoveSimilarity
This sets the base similarity threshold, in percent, for detecting moved blocks within a file.
The default is 60, and the maximum is 100.
Short blocks require stronger matches.