Content
- 1 DiffFork
- 2 Quick Start
- 3 Diff Text Files
- 4 Diff Folders
- 5 Others
Content
DiffFork is a diff tool for Mac OS X. DiffFork can compare both folders and files, presenting differences in a visual format.
DiffFork supports Scrolling in Sync and Block Guide to help you identify the differences in the counterpart text files. Block Guide is the linking lines between the blocks.
Differences are marked with background colors according to their Types:
Differences in DiffFork have Levels to help you understand them more easily. For more information, please see the next section "Nested and Darker".
There are three level differences: Level 1(Block), Level 2(Line) and Level 3(Character). The Level 3 is nested in the Level 2, and the Level 2 is nested in the Level 1.
Nested differences are marked with darker background colors.
Level 1 (Block)
Differences between lines. A Level 1 difference block can across multiple lines of text.
Level 2 (Line)
Differences based on one line. The Level 2 difference always and only contains one complete line of text.
Level 3 (Character)
Character (word) differences between one line.
These kinds of "Levels" may seem overly complicated, but it will feel more natural when you see how DiffFork presents differences in action. We hope these "colorful differences" can help you to understand the differences more easily.
When navigating the differences, the visual feedback mechanism proves very helpful.
A thin blue border will be displayed around the text of the selected block.
For the "insertion", a Ribbon (red or green, depending on the context) will be displayed to the left side of the text, in the place where the insertion is supposed to occur (or occurred).
(For more information about the ribbon, see the following section "Ribbons").
A small black dot will be displayed in the corresponding "Difference Ribbon", to the left of the selected line. The selected line will also look darker.
For the "insertion", a "Ribbon" (red or green, depending on the context) will be displayed to the left side of the text, in the place where the insertion is supposed to occur (or occurred).
For the "insertion", an icon (red or green, depending on the context) will be displayed below the line of text, in the place where the insertion is supposed to occur (or occurred).
DiffFork displays "difference ribbons" to the left of the text. Ribbons have the same background color as the corresponding differences, and they can be selected and highlighted as well.
Unmodified blocks (same text) can be selected, as well as other differences blocks, to help you find and locate the corresponding text. For more information, please see the next section "Aligning Blocks".
To easily locate the differences in the counterpart text file, you can make DiffFork to align the blocks by selecting while pressing the Control key. You can change the preferences to use other modifier keys.
Suppose we are differencing text files A and B. When you align a difference (select a block or a line while pressing Control key) in A, the corresponding difference in the counterpart text file (B here) will be selected as well. In addition:
You can "input wherever you have output". Differences will be updated according to your changes.
When you open text files, DiffFork attempts to determine the encoding of the files, so they can be read and displayed correctly.
See the Help for a complete encoding list.
The customized text editor supports customizing "Insertion Cursor". We love it, and we hope you will too.
The folder diff involves two steps: the first "Shadow diff" and the second "Binary diff". In the first step "shadow diff", DiffFork scans folders and do a fast inaccurate compare to find out the initial different items (files and folders). And then, in the second step "binary diff", items marked as SAME in the previous step are compared again byte for byte for accurate results.
DiffFork displays differences only. Items with the same content will be hidden.
Differences include:
There are two columns on the left of the item, which represent the diff results. The first column is for the left folder, and the second column is for the right folder.
The meaning of the icons:
Dot: File or folder exists.
Also, both compared files exist but the content is different.
None: File or folder doesn't exist.
Double click the listed item to open a new text diff window.
When DiffFork scans folders and does the diffing, the results will be displayed as soon as possible when the underlying data is available. You don't have to wait until the whole process is completed.
DiffFork uses a config file to control its behavior when it scans for files that it is to exclude. Excluded files will not be diffed and displayed.
To edit the config file, choose Preferences... from the application menu, and switch to "Folder Diff".
The config file consists of a list of patterns, with one pattern a line. The # character is treated as a comment character.
Two types of pattern syntax can be used: glob and regular expression. To change the syntax, use a line of the following form:
syntax: TYPE
TYPE is one of the following:
The assigned syntax stays in effect until another type is specified. You can also assign a syntax for a pattern using prefix, which overrides the global syntax. An Example:
regexp: (^|/).
Applying exclude rules on each file takes time, which may slow down the diff process dramatically. Set up the rules with care to avoid the performance issue.
Starting from version 1.1.6, the DiffFork command-line utility supports OPTION "-w --wait", which can be used to help work with Git, Mercurial, Subversion, etc.
Note: DiffFork can compare 2 folders/files. 3-way diff/merge is not supported.
To install the command-line utility, choose "Install Command-Line Utility..." from the Help menu.
USAGE
difffork file1 file2 [OPTION]
DESCRIPTION
-w --wait
Wait for the diff window to be closed.
The integration instructions provided in this document is a starting point. For more information, please reference the VCS document or contact us for support.
#!/bin/sh
difffork "$2" "$5" -w
export GIT_EXTERNAL_DIFF=FULLPATH
git diff
Mercurial has a detail instruction on how to use external programs to compare revisions, or revision with working dir: http://mercurial.selenic.com/wiki/ExtdiffExtension
To use extdiff command:
[extensions]
hgext.extdiff =
hg extdiff -p difffork -o -w
To create custom extdiff commands:
[extdiff]
# add new command that runs DiffFork
cmd.dfdiff = difffork
opts.dfdiff = -w
hg dfdiff
Subversion has an instruction on how to use external programs: http://svnbook.red-bean.com/en/1.5/svn.advanced.externaldifftools.html
#!/usr/bin/env python
import sys
import os
# Configure your favorite diff program here.
DIFF = "FULLPATH"
# Subversion provides the paths we need as the last two parameters.
LEFT = sys.argv[-2]
RIGHT = sys.argv[-1]
# Call the diff command (change the following line to make sense for
# your diff program).
cmd = [DIFF, LEFT, RIGHT, '-w']
os.execv(cmd[0], cmd)
# Return an errorcode of 0 if no differences were detected, 1 if some were.
# Any other errorcode will be treated as fatal.
svn diff --diff-cmd svndfdiff.py