Updated 2016-08-08 17:07:14 by spjuth

This page describes the tkdiff application, a GUI interface to the Unix diff command, together with several source code control systems that appear to use tkdiff.

Were you instead looking for information on how one might implement diff in Tcl?
 What: tkdiff
 Where: http://tkdiff.sf.net/
 Description: TkDiff is a Tk based interface to the Unix diff command which
        provides highlighting of difference regions, side by side viewing of
        files, linked scrolling, random access to the difference
        regions, file merge, and online help.  Requires Tcl/Tk.  Also
        supports SCCS, RCS, and CVS, and Subversion.  Built-in editor,
        find facility.
        Works with Tk 3.x,4.x and 8.x.
        A binary version for i386_linux is also available.
        Version 4.1.4 is available.
 Updated: 11/2007
 Contact: See sf.net web site

escargo 28 Feb 2003 - When I downloaded tkdiff 3.09 and ran it on windows it blew up. The problem appears to be the grid commands at lines 5953 and 5967. They use a "-pad" argument that was not understood by my ActiveTcl 8.4.1 installation. Looking at HTML man pages as far back as tk 4.2, there was no "-pad" option. I don't know how this code worked before. Maybe there was a regression in tolerant code before, but I replaced the "-pad 4" with "-padx 4 -pady 4" and the application ran again.

ET 11oct2003 I am using 8.4.4 on Windows and found that the following is needed to use 3.09 (near the very end of the file)
    if {![llength [info commands tkCancelRepeat]]} {
       tk::unsupported::ExposePrivateCommand tkCancelRepeat
       tk::unsupported::ExposePrivateCommand tkTabToWindow

before the call to main.

escargo 13 Nov 2003 - The correct function of tkdiff depends on the diff program that is used. I am using ActiveTcl 8.4.4, and I am running into problems with diff not behaving as the tkdiff program expects. The first problem was that temporary files were created in a file name that used the value of the environment variable TEMP (or perhaps TMP), which in Windows contains backslashes. When I temporarily put the temp directory as the volume root (that is, C:), diff failed differently. Is this a known problem? (Is there a known solution?)

LV What system and what diff are you using? That probably is the best place to begin. Also, you might sign up for the tkdiff mailing list - the experts there are most likely the ones most able to help.

escargo 14 Nov 2003 - I am using ActiveTcl 8.4.4 on Windows XP Pro Service Pack 1. The diff program is the diff.exe from the http://www.accurev.com/free/tkdiff/ page (which claims to be GNU diff 2.7, though diff 2.8.1 might be available now). I will also try the mailing list.

TSBG 2003-11-16 : I had the same problem. I have made a patched version of tkdiff-4.0b2 which you can get from http://homepage.hispeed.ch/tsbg/tkdiff-4.0b2.zip. Please try it out. The diff program from accurev works ok for me.

escargo 17 Nov 2003 - This solved the problem for me; there are certainly interesting differences between tkdiff 3.09 and 4.0b2. (Interestingly, the tkdiff.kit mentioned below has the same problem as 3.09.) - now fixed, thx -jcw -- The good news, it works now; the bad news, it's not cleaning up temporary files when it's done. - escargo
 What: AccuRev
 Where: http://www.accurev.com/
 Description: Commercial Source Code Management (SCM) tool.
         Has integrated TkDiff.  A Tk GUI interface is being
         developed.  Comes with an unlimited time 2 user license,
         and with support and more licenses available for purchase.
         Currently at v3.0 .
 Updated: 08/1999
 Contact: mailto:[email protected]
 What: Aegis
 Where: http://www.canb.auug.org.au/%7Emillerp/aegis.html
 Description: Transaction based software configuration management (SCM)
         system.  Provides software to coordinate and integrate the changing of
         software by a team of developers.  Has a Tk interface, as well
         as a utility for interfacing to tkdiff.
         Currently at version 4.6 .
 Updated: 06/2001
 Contact: mailto:[email protected] (Peter Miller)

 What: wtkdiff
 Where: http://sheol.org/throopw/wtkdiff.html
 Description: Little brother to tkdiff.
 Contact: mailto:[email protected] (Wayne Throop)

See also bindiff for comparing binary files.

I've updated tkdiff.kit in sdarchive to 4.0b2 - when renamed to "tkdiff" and placed in the path, it works fine with Keith Vetter's Wiki History Diff script -jcw

escargo 26 Mar 2004 - The info button in the sdarchive has dates for 2002; that would seem to be out of date relative to the notice above. Plus, tkdiff 4.0 was announced on freshmeat.net on 25 Mar 2004. The starkit should be updated (and then this comment removed).

You might try updating the starkit yourself, then emailing jcw to ask whether he would like to have the updated version...

August 15 2004 - tkdiff on OSX 10.3.5

the big fat .dmg immediately exits on my OSX system, perhaps a clash with the built-in tcl?

Any rate, using the small tkdiff for unix and placing it in /usr/local/bin/tkdiff on OSX works just dandy, and starts up quickly.

Now I'm trying to fiddle with the source to make the window appear in the foreground and a lot larger...

- John Buckman mailto:[email protected]

See also eskil for an alternative to tkdiff.

Eskil is another Tcl/Tk based diff that includes:

  • Highlights changes within a line.
  • Matches similar lines within a changed block to better show changed lines that are adjacent to added/removed lines.
  • Directory diff.
  • CVS/RCS/ClearCase diff. CVS conflict merge.
  • View patch file.
  • Print to postscript.
  • "Clip diff"
  • Alignment and block diff functions for tricky diffs.
  • Edit and Save file from diff window.

I highly recommend eskil over tkdiff. tjk

LVwikignome - 2012-01-10 14:31:45

Is there a way to configure tkdiff to only display the specific difference within a line, rather than highlighting the entire line?

AK - 2012-01-10 16:22:47

While I don't believe that tkdiff is supporting the festure you are asking for, I know that eskil does, and has, IIRC, this mode of display active as default.