The graphical diff tool Eskil is packed with features

vrozhko, 123RF

vrozhko, 123RF

Minor Changes

With Eskil, you can easily compare the differences between files. If necessary, you can even compare them with a version control system.

Maintaining program code is almost like moving pieces on a chessboard: you can observe column and line changes precisely between moves. However, if this analogy is stretched to imagine a board that has far more than the usual 64 squares, extended over several levels, the human eye is hardly sufficient for spotting changes. Diff programs such as Eskil [1] can be used to help analyze lengthy blocks of code.

Eskil's program interface is unremarkable; software functions are nestled behind very simple menus. Eskil works with Tcl/Tk, so install this first. If necessary, download the software from the website. The "Installation" box provides information on how to do this manually.

Installation

Download the latest GZIP package from [1] and uncompress it with:

gunzip eskil273.linux.gz

Version 2.7.3 was the latest version at the time of publication.

Make the uncompressed files executable with:

chmod a+x eskil273.linux

and Eskil is ready to launch:

./eskil273.linux

You can also move the executable file eskil273.linux to /usr/local/bin/ or another directory on your PATH and create a symbolic link for eskil . Just like that, it will be available to all users.

You can move the program manually to your desktop environment's Start menu. Some file managers also allow you to create a desktop shortcut. If you want to edit files from within Eskil, install Emacs.

Startup

If you start Eskil from the terminal, you can directly invoke files (Listing 1, line 1) or directories (Listing 1, line 2) for comparison. There are some interesting options you can use on the command line, many of which you can read about in Table 1. Alternatively, you can open files in the program interface via the menu item File | Open both … – first left, and then the right.

Listing 1

Opening files

01 $ eskil <ßßI>file1<ßßI> <ßßI>file2<ßßI>
02 $ eskil <ßßI>Folder1<ßßI> <ßßI>Folder2<ßßI>

Table 1

Program Options at Startup

Parameter Action
-browse Open files at startup
-context <n> (or just <n> ) Lines before and after the deviation
-print <file> Create PDF file with deviations only
-table Compare tables (changes are displayed in the affected column)

By default, the font size is very small. Click Options | Font | Select … , and select the type and size of the font to fix this. The default fonts are all monospaced, i.e., the characters all take up the same amount of horizontal space (Figure 1).

Figure 1: If the font is too small, the software allows you to select a different font and/or font size.

Uncheck the Fixed box to see a list of all installed fonts. However, avoid these for text files as the overview will become muddled with a variable width font. Save your settings with Options and Save default .

Comparing Text

In the example shown in Figure 2, the tool compares the text file airport.py (left) with airport2.py . The various color codings indicate additions, changes, or missing text. Table 2 summarizes the corresponding system for marking the deviations.

Figure 2: Both text files contain almost the same content. The tool highlights any differences using color coding.

Table 2

Color Rules

Color Left File Right File Meaning
Pink/Red X X Difference in line numbers
Green X - Deviation from the left side
Blue - X Deviation from the right side

The toolbar helps you to work through differences step by step. Activate this with Options |Toolbar (Figure 3). The software then displays the selected line numbers in red on a yellow background. Click on Next Diff to view the next difference. You can use Prev Diff to jump back to the previous difference, too.

Figure 3: If you have activated the toolbar, you will have access to buttons that allow you to step through the differences between the files.

If you prefer to work with a felt tip pen and ruler, or simply want to display differences in black and white, use File | Print PDF … . You can use this menu to remove colors and other frills.

Merge

To merge files, click Tools | Merge . A new pop-up window (Figure 4) will open, where you can jump between divergent data using the Next and Prev buttons. You then decide whether you want to use the version in the main window on the left (L ) or on the right (R ).

Figure 4: Use the Merge function to merge two files with differences.

If you want to insert differences instead, use the functions LR and RL instead of L or R . With LR , the text in the left column remains unchanged; differences in the right column are listed below. In the case of RL, this works in exactly the opposite way.

Comparing Directories

With Eskil, you can compare the contents of different subdirectories. After the program has started, the software to do this will load. The following rules apply to the color scheme for object names:

  • Black indicates identical objects on both sides;
  • Red on both sides indicates they aren't identical;
  • Blue indicates objects that exist only on the left.
  • Green indicates objects that exist only on the right.

Figure 5 shows what the above looks like. The left column contains the contents of both subdirectories. If you want to move up a level in the directory tree in the left pane, click on the button with the single green arrow on the left of the toolbar. If you want to move up in the directory tree in the right pane, do the same using the button with single green arrow on the right of the toolbar. If you want to move up in both panes, use the button with the double arrow in the center of the toolbar.

Figure 5: The Compare Subdirectory window is more complex than the Compare File view.

Go down the directory listings by right-clicking, and then choose go down left or go down right . Right-click on the directory under Structure to call other functions.

Use Expand all to open the entire structure to be compared in the window. Conversely, Collapse all will display the folder comparison as a small symbol beside Structure . You can access these same functions by clicking on the small arrow icon, which opens and closes directory trees.

If you want to list identical objects, use prune equal . However, there is no option to remove this filter in the Context menu. Instead, use Alt+C or File | Compare to switch back to full view.

Compare files marked as different (red) by clicking on them in the Structure column to highlight the line. Next, mouse over one of the data columns and right-click. The Context menu will open, and you can select Compare Files . Your comparison window will now appear.

If you want to copy a file completely, use the buttons on the arrow in the Copy column or by right-clicking CopyFile to… in the source column. This will sync files on a case-by-case basis.

This does not work the same way for subdirectories. Although the program here offers the arrows, you cannot use them to make copies of folders. Eskil also does not allow you to create new directories and copy data to them.

The program does not automatically update the display after a command is run. Use Alt+C or File | Compare to refresh.

If you click on Edit Left File or Edit Right File in the menu, an editor opens, and you can modify the file if necessary. Emacs was used in our test, but you can specify a different editor using the file ~/.eskilrc . To do this, enter the line in Listing 2 and save the file.

Listing 2

Changing the default editor

set ::Pref(editor) <ßßI>editor<ßßI>

VCS Integration

Eskil can be integrated into version control systems (VCS) whereby several systems are used in parallel. According to the Eskil website, the tool supports RCS, CVS, Git [2], Fossil [3], Mercurial [4], Bazaar [5], and Apache Subversion [6]. Other diff tools, such as Perforce and ClearCase, don't support these functions.

If you use more than one system in a directory, Eskil prefers the variants Git, Mercurial, and Bazaar to CVS and Subversion. Use the options -svn or -cvs to manually clear programs with the same name.

We used Git to test this feature. Start the program and click on File | Revision Diff . Next, select the local file on the right-hand side. The left view then shows the contents of the file in the VCS (Figure 6).

Figure 6: Eskil is compatible with several VCAs, but becomes unstable if you try to use them in parallel.

You can also transfer changes from Eskil to the VCS. To do this, click Commit , and enter a comment in the new window that opens. Next, close the input with Commit , and then click File and Redo Diff . Both views will now show no differences.

You can also do this the other way round: If you want to modify local data, click on Revert . The content will then correspond to that of the VCS. View this with File | Redo Diff to update.

Conclusion

Eskil is a small, fine tool for all tasks related to comparing files and directories. While there is some room for improvement, it performed so well in our tests, that it is perfectly suitable for everyday use.

Tip

During testing, when comparing directories, we found starting from the shell was fastest.