# Options for Comparing and Merging Directories

The KDiff3-preferences (menu "Settings"->"Configure KDiff3") now has a section called "Directory Merge" with these options:

Recursive Directories:

  Select whether to search directories recursively.

File Pattern(s):

  Only files that match any pattern here will be put in the tree. More than one pattern may be specified here via using the semicolon ";" as separator. Valid wildcards: '*' and '?'. (e.g. "*.cpp;*.h"). Default is "*". Directories need not match this pattern.

Anti-Pattern(s):

  Files and directories that match this pattern will be excluded from the tree. More than one pattern may be specified here via using the semicolon ";" as separator. Valid wildcards: '*' and '?'. Default is "*.orig;*.o".

Use CVS-Ignore:

  Ignore files and directories that would also be ignored by CVS. Many automatically generated files are ignored by CVS. The big advantage is that this can be directory specific via a local ".cvsignore"-file. (See info:/cvs/cvsignore.)

Find Hidden Files and Directories:

  On some filesystems files have an "Hidden"-attribute. On other systems a filename starting with a dot "." causes it to be hidden. This option allows you to decide whether to include these files in the tree or not. Default is on.

Follow File Links:

  For links to files: When disabled, then the symbolic links are compared. When enabled, then the files behind the links are compared. Default is off.

Follow Directory Links:

  For links to directories: When disabled, then the symbolic links will be compared. When enabled then the link will be treated like a directory and it will be scanned recursively. (Note that the program doesn't check if the link is "recursive". So for example a directory that contains a link to the directory would cause an infinite loop, and after some time when the stack overflows or all memory is used up, crash the program.) Default is off.

List only deltas:

  Only items that are not equal in all input directories will be listed and only the changed files are visible. Hence files that are equal in all directories won't be copied during a merge and if the destination dir does not contain the files before the merge, you might miss some files later. (This option is likely to be changed in a later version.) Default is off.

File Comparison Mode:

  Binary Comparison:

    This is the default file comparison mode.

  Full Analysis:

    Do a full analysis of each file and show the statistics information columns. (Number of solved, unsolved, nonwhite and white conflicts.) The full analysis is slower than a simple binary analysis, and much slower when used on files that don't contain text. (Specify the appropriate file-antipatterns.)

  Trust the modification date:

    If you compare big directories over a slow network, it might be faster to compare the modification dates and file length alone. But this speed improvement comes with the price of a little uncertainty. Use this option with care. Default is off.

  Trust the size:

    Similar to trusting the modification date. No real comparison happens. Two files are considered equal if their file-sizes are equal. This is useful when the file-copy operation didn't preserve the modification date. Use this option with care. Default is off.

Synchronize Directories:

  Activates "Sync-Mode" when two directories are compared and no explicit destination directory was specified. In this mode the proposed operations will be chosen so that both source directories are equal afterwards. Also the merge result will be written to both directories. Default is off.

Copy newer instead of merging:

  Instead of merging the proposed operation will copy the newer source if changes happened. (Considered unsafe, because it implies that the knowledge, that the other file hasn't been edited too. Check to make sure in every case.) Default is off.

Backup files:

  If a file or complete directory is replaced by another or is deleted then the original version will be renamed with an ".orig" extension. If an old backup file with ".orig" extension already exists then this will be deleted without backup. This also affects the normal merging of single files, not only in directory-merge mode. Default is on.