Diffkey Command

The Diffkey Command

  • diffkey <key> <diffkey-opt>* <cmdline-opt>*
    d <key> <diffkey-opt>* <cmdline-opt>*
     
    where:
    <diffkey-opt>
    :=
    <diff-opt> | <filter-opt> | -ver <date-spec>
    | -astext | -nottext
    | <other-opts>
    <diff-opt>
    :=
    -comp | -c
    | -edit | -e
    | -diff | -df
    | -nodiff | -n
    | -keep | -k
    | -windiff
    <filter-opt>
    :=
    -excl <filelist>
    | -only <filelist>
    | -file-list <filename>
    <date-spec>
    :=
    <relative-ver> | <date-ver>
    <relative-ver>
    :=
    a negative number, e.g. -1
    <date-ver>
    :=
    <mmddyy>[.<vv>]
    <mmddyy>
    :=
    a date string, e.g. 021715
    <vv>
    :=
    a two-digit version number, e.g. 04
    <filelist>
    :=
    "<file>" [ "<file>"]+
    <cmdline-opt>
    :=
    See section on "Command Line Options".
     
    advanced features:
     
    <other-opts>
    :=
    -share | -sh
    | -noshare | -nsh
    | -servloc
    | -notasdir | -asdir
    | -deldiff | -dd
    | -list
    • Compares the files in the local location of the key to those in their server locations.
    • The 'diffkey' command creates a report that shows which files were changed, which were added, and which were deleted. If the two locations were not different, it issues the message "NO FILES CHANGED".
    • Hyperkey reports non-text files as being 'changed' if the file time stamps in the two locations do not match.
    • Hyperkey reports text-type files as being 'changed' if the file text contents in the two locations do not match. For more details, see the section on "File Comparision In Hyperkey" below.
    • For file extensions that are marked as being of type 'text', it invokes the diff program to show the lines that were different between the two versions, unless the '-nodiff' option is specified.
    • The '-excl <filelist>' option specifies the files or filename patterns that not to be compared. All other files within the range of effect of the key will be compared normally.
    • The '-only <filelist>' option specifies that only the files in the list of filenames or filename patterns are to be compared, and all others are ignored.
    • The '-file-list <filename>' option specifies that only the files in the list of filename stored in the given file are to be compared, and all others left alone. This is basically the same as the '-only' option, except that the file names are stored separately in a file, instead of being specified in-line.
    • If the '-ver' option is specified, compares the local copy to the version that was saved under that date and Incremental version number. The <date-spec> follows the same syntax rules as the 'restore' command.
    • The '-comp/-c' option will open an text editor the two files of the two directories being compared for files that are detected as changed and of type text. This can be very handy if one has a text editor capabable of comparing text in two windows.
    • The '-edit/-e' option will open an text editor (by default, gedit) on a file containing the listing of the changes of text-type files. This allows one to scroll through the results of the diff program.
    • The '-diff' option specifies that when showing the differences, file content differences will be displayed for all files as if they were text files. This can be useful to see changes for files whose extensions are not known to Hyperkey as being of type 'text'.
    • Conversely, the '-nodiff/-n' option specifies that when listing the differences, no file content differences will be displayed, even text for files. This is often helpful when one wishes to know which files changed, but do not want an excessively long listing of the changes.
  • EXAMPLES:
    • Show the differences between the local copy of key of 'vi' and the current version of the server copy:
      • d vi

    • Show the differences between the local copy of key of 'vi' and the current version of the server copy, but only of those files that have file extension '.vi':
      • d vi -only *.vi

    • Show the differences between the local copy of key of 'vi' and the current version of the server copy, excluding files that begin with 'Build':
      • d vi -excl Build*

    • Show the differences between the local copy of key of 'vi' and the current version of the server copy, using timestamps only:
      • d vi -nottext

    • Show the differences between the local copy of key of 'vi' and the version of the server copy of the backup before the last one:
      • d vi -ver -1

  • Less-common options
    • The '-astext' option specifies that all files are to be treated as text for the purposes of detecting changes.
      • NOTE: This option can result in a much slower response than normal if there are a large number of files that are actually text files but their extensions are not marked as such.
      • NOTE: One word of warning: the diff program may return an error if comparing binary files.
    • The '-nottext' option specifies that no files are to be treated as text for the purposes of detecting changes. This can result in faster response times. But it will also show text files as having changed when they have different timestamps, even when the text content is identical.
    • The '-windiff' option specifies that the WinDiff program is to be used to display the differences between the local and server directories. The WinDiff program will launch whether or not Hyperkey reported any differences or not.
    • The '-keep/-k' option specifies that regenerated files are not to be deleted in the temporary storage area after the command exits. This option only applies if comparing the current local files to an older version, and the server files had to be regenerated in order to do the comparison. These files are normally deleted when the command exits, to save disk space.
    • The '-deldiff' option specifies that the temp file used to generate the file difference listing is to be deleted after the command finishes.
  • How Files Are Compared In Hyperkey
    • When checking if files are different between local and server locations, Hyperkey treats file extensions that are marked in the init file as being of type 'text' differently than those that are not.
    • Non-'text' type files are considered to have been changed if the file timestamps in the two locations do not match.
    • By default, files of type 'text' are only considered to have changed if the text content of the files are different, even when the timestamps are different. This can greatly reduce the number of changes reported, because text files are often re-saved when no changes were made. This default can be overridden by the '-astext' and '-nottext' options of 'diffkey' and 'bak'.
    • To determine whether 'text'-type files have been modified, Hyperkey invokes the diff program to compare each pair of files, and only determines that a text file has changed if diff returns a difference.
    • NOTE: Comparision of files by the diff program is noticeably slower than comparison by timestamp. For this reason, it is sometimes desirable to use the '-nottext' option for faster results, even though it will show any text files as having changed if they have different timestamps.
    • For more information on marking file extensions as being of type 'text', see the section on "Defining TextTypes" .
Previous: Backup Command Next: Restore Command