diff --git a/ChangeLog b/ChangeLog index d67e688..25c235d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,574 +1,574 @@ -Version 1.7.0 - 2017-01-23 +Version 1.7.90 - 2017-01-23 ============================ -ported to QT5/KDEFramework5 -depreciated cmake 2.8.12 support in master -abandonded Konqueror specific plugin no longer applicable. -kde4 support dropped due to extensive changes needed for QT5/KDEFramework5 -QT5 now required because of above changes. -bugfix: Show Indentical files setting not applied after rescan. -Change parameter errors to use dialog on Linux as well as console output. -Don't sort twice when sorting in reverse order. -fix memmory leak introduced in 0.9.91. -change version numbering. -scrap ClearCase support Version 0.9.98 - 2014-07-04 =========================== - Text rendering now with QTextLayout fixes the following issues - Correct handling for variable width fonts. - Corrected display of highlighted text with Qt4.8.x on Ubuntu and Mac. - Improved handling of texts with both right to left and left to right languages (mixed Arabic and western texts). - Improved handling of Chinese and Japanese. - Whitespace characters are now shown as dots for spaces and arrows for tabs, and not only in differences. - Fixed symlink comparison (Qt4 symLinkTarget returns absolute paths) - Text analysis for rendering with QTextLayout is interruptable and multithreaded. (See progressbar and abort-button in statusbar) - Fix for saving to relative path in KDE-environments. (Patch from Harald Sitter) - Fixed bug in 0.9.97: Directory compare was always case sensitive. - Fix for saving files on KDE with relative path specified via command line option -o. - Fixed problem with KIO (nonlocal urls). - Improved Mac support. - Write --confighelp information to stdout instead of stderr. - Directory Merge Window: Enabled state of "Delete A And B" now also depends on existence of source file A. - Works now with Qt4 and Qt5 - Progress dialog during printing. - Workaround for bug in QSplitter::childEvent that broke QFileDialog::getSaveFileName Version 0.9.97 - 2012-08-10 =========================== - Memory usage optimized for comparison of large directories. (ca. 1/5 needed) - On Windows use config file .kdiff3rc next to kdiff3.exe if exists. - In overwiev for two way diff show if only one side contains text. - Fix for Fedora by Neal Becker in src-QT4/kdiff3part.desktop. - When word wrap is active toggling line numbers now recalculates the word wrap. - Removed confusing "For compatibility ..." hint from option -qall - Fixed mouse wheel problem. (Patch by David Hay) - Change an encoding in diff text window via click on encoding label. (Patch by Alexey Kostromin) - Fix for tab-key moving focus instead of adding a tab character in MergeResultWindow. - Workaround for git on Cygwin that allows KDiff3 to find files in a Cygwin "/tmp" directory when environment variable "CYGWIN_BIN" is set. (Patch by Nigel Stewart) - Removed iostream dependency (Patch by Nigel Stewart) - Regression test framework (by Maurice van der Pot) - Documentation patch (by Burkard Lueck) - Select text in Find dialog (by Eike Sauer) - If text is selected in either input or output window use that in Find dialog. - Added default directory anti patterns ".hg" and ".git" and file anti patterns ".rej" and ".bak" for better mercurial and git integration. - Command line option --cs doesn't change the config value permanently anymore. - On KDE: Not creating a KDiff3Part anymore. - Windows (Vista or Win 7): Shell context menu in directory comparison view now again displays text. - Windows 64 bit: Diff-Ext-for-KDiff3 context menu now installed as 32 bit and 64 bit versions to allow other 32 bit programs to use it too. - Windows 64 bit specific installer. Version 0.9.96 - 2011-09-02 =========================== - KDiff3FileItemActionPlugin : Context menu that also works in dolphin (for KDE>=4.6) - Parser for preprocessor commands. (Allows single apostrophs ') - On Windows if the preprocessor command is "sed" try to use a "bin\sed.exe" next to the kdiff3.exe, if available. - Warn if conversion errors appear (Invalid characters) - Fix crash on A/B-overview (infinite recursion) - Fix clearcase temp files not deleted problem on windows - KDiff3 plugin: When launching KDiff3 konqueror isn't blocked anymore - String corrections (Frederik Schwarzer) - Fixed writing to KIO. - OS2-Port (Patch by Silvan Scherrer) - Fixed problem where destination directory would be renamed or deleted during copy operation. Now if the destination directory exists only the files inside will be copied. - In merge: Separate lines where the automatic choice would be the same but for different reasons. - Fixed some problems with huge files in directory comparison mode (>2GB) (but direct comparison is still not possible) - Fixed documentation compile errors with KDE>=4.5 - Fixed white space merge default options - Fixed regexp test tool. - Exclude printing code if Qt was compiled without printing support. - For Windows: Fixed handling of unicode characters in command line parameters. - Improved "old mac" lineendstyle handling: Break lines. - Detect encoding specified in xml header or html "meta" tag. Version 0.9.95 - 2009/03/03 =========================== - Show line end style for each file. - Updated message translations. - Fixed permissions when writing executable file. (Un*x only) - Fixed IgnorableCmdLineOptions (important for SVNs '-u'-option) - Directory merge: Error when either B or C is changed and the other is deleted. (User choice required.) - Qt-only Un*x-version looks for translations in /usr/share/locale//LC_MESSAGES/kdiff3.qm (for Debian, by Eike Sauer) - New script: po/create_qm_files: To create and install translations for Qt-only version. Version 0.9.94 - 2009/01/17 =========================== - Fix for hidden text windows with --auto-flag. - Fix for pasting clipboard truncated text if it contained characters that needed more than one byte in UTF-8 encoding. - Fix for horizontal scrolling if word wrap is enabled. - Directory tree: files hidden due to options (e.g. patterns etc.) don't affect folder equality any more. - KDE: KIO-progress dialog is now hidden. (KDiff3 has its own progress dialog.) - Directory merge: Default op for change in either B or C and delete in the other is now merge (previously copy). - Directory merge: Not preserving merge operation after reload, because it might have changed. Version 0.9.93 - 2009/01/06 =========================== - Support for KDE4 (with much porting help from Valentin Rusu) - Fix for diff_ext_for_kdiff3 (by Sergey Zorin) - Win32-Installation: SendTo-integration fixed for Vista. - Optional auto detection of line end style for saving. - Option to close on ESC (default is off) - Option to align B and C for 3 input files (default is off which is usually better for merging). Version 0.9.92 - 2007/04/15 =========================== - Windows installer now allows you to install KDiff3 as Clearcase Diff and Merge Tool - Windows installer "SVN Merge tool" corrected: Not creating $AppData\Subversion\config subdir anymore. - KDE-Konqueror plugin: Launch KDiff3 from Konqueror. (Similar to Diff-Ext on Windows.) - Qt4-version - Printing crash fixed - Compilation issue for Mac fixed - Dir Rescan keeps settings for Show identical files etc. - Bugfix: Empty file and not existing file were detected as binary equal. - Temp file names use the process id in file name to allow several instances. - Suppress flicker during startup. (Don't show status info window on creation.) - New File comparison mode: Trust the size and date, but use binary comparison if date doesn't match (unsafe) - After explicitly selecting files any file of the selected may be right clicked for context menu. - Open dialog also shows current directories in directory comparison mode. - Writing a file via --auto option didn't work for relative files. (Reported by Guilhem Bichot) - New option for history merge: Max number of history entries - New option "Auto save and quit on merge without conflicts" - Directory Merge with Case sensitivity disabled: Correct destination filename chosen for merge. Version 0.9.91 - 2006/10/29 =========================== - Encoding auto detection - Fix for crash after double click below last line - Saving of maximized window-state (Patch by Robert Vock) - Separated Merge-options in own tab because "Diff and Merge"-options tab got too big. - When pasting multiple lines into openfile dialog only first line is kept - Drawing in directory view fixed. - When specifying a separate output dir then for equal files a copy operation will also be offered. - Windows specific: - Windows installer problems fixed for users without admin-rights - Fix for slow startup problem on Windows (Patch by Manfred Koehler) - New: diff-ext-for-kdiff3 - Shell extension (originally by Sergey Zorin) - Qt4-version: - Saving of merge-result didn't work. - Start external processes directly without cmd.exe-window - Rewrote everything requiring Qt3-support Version 0.9.90 - 2006/05/14 =========================== - Fixed KIO-problems of type "File exists" with tempfiles (introduced in 0.9.89) - Fix for manual alignment with 3 files which caused crash (new feature in 0.9.89) - Fix for Alt-Left caused crash for leftmost window on windows (due to changed compiler) - Use of WResizeNoErase|WRepaintNoErase instead of WNoAutoErase (fix for compiler error with Qt3.1) - Removed #include which is (currently) unneeded and required extra dependencies. - Removed "Save/Load Directory Merge State ..." in directory menu. (These aren't working yet.) - Fixed crash when used as Diff-part with KDevelop. - Preserve executable bit when overwriting an existing file. Version 0.9.89 - 2006/04/09 =========================== New features: - Version control history auto merge plus sorting - Auto merge regular expression - Splitting and joining differences for merging - Manual Diff Alignment tool - Printing of differences - Colorsettings for Dir-Colors - Dir-show identical/different/A-only/B-only/C-only files with immediate effect (instead of option "List only deltas") - Filename-edit above DiffInputWindows - Windows-Context Menu in A/B/C-columns for dir-comparison (Windows only) - Edit Menu: Select All (Ctrl-A) - New commandline options: --config filename: Select an individual config file. (Now also available for Windows and Qt-only version.) --cs config: Change one specific setting via the command line. (For settings that were previously adjustable via GUI only.) --confighelp: Show available config items and their current values. - Dircomp: "Compare/Merge explicitly selected files" (Select files/dirs by clicking icons in columns A/B/C) - User definable ignored command line options. - Ability to swap pathnames in open dialog - "Ignore"-button in error dialog when option not understood (Windows only) - Quadratical scroll speedup during selection when mouse moves out of the diff input window. Bugfixes, redesign: - Preparations for Qt4-Port + some redesign - GNU-Diff algorithm improved to be independent of line endings (needed for manual diff alignment) - Avoid restoring a window where it is almost invisible (if moved almost out of the screen area) - Go to next delta honors special "A vs. B", "A vs. C" or "B vs. C" overview when active. (Patch by Vladan Bato) - DirectoryMergeWindow: File/Antifile and DirPattern changes will update immediately without rescan. - Blue toolbar icons (for better visibility of disabled state) - Bugfix: Crash when merging and selecting "Choose A/B/C for all unsolved conflicts" and one of the solved conflicts contained no lines in chosen input. - Fix: With --auto option, GUI stays invisible if not necessary - Fixed odd ProgressDialog-behaviour when continuing after an error or abort. - Directory merge: Fixed FollowFileLinks. (Didn't work when copying a file.) - Initial position now (x=0,y=22). This solves a problem on some Macs. - Better alignment of B and C in 3-file comparison - Correctly updating the selection when scrolling via keys and mouse is pressed - Horizontal scrolling in right-to-left language caused vertical lines - fixed. Version 0.9.88 - 2005/25/02 =========================== - Fixed crash that occurred in Directory Comparison mode "Full-Analysis". - Fix for Windows: Didn't save encoding correctly. - Many translations updated. Version 0.9.87 - 2005/30/01 =========================== - Unicode16 and UTF8 support (Internal data format is now QString (Unicode16). Conversion during save and load.) - Directory "Full Analysis": Equality-Coloring for files with only whitespace differences. (Michael Denio) - Support for right to left languages. - In MergeResultWindow show "" for whitespace-only conflicts - Statusbar shows the number of remaining conflicts and whitespace conflicts. - Go Next/Prev Difference/Conflict now have improved tooltips informing about "Show White Space"-disabled-behaviour. Version 0.9.86 - 2004/06/14 =========================== - Double click on any file in directory merge would close the directory merge window. (Regression in 0.9.85) Version 0.9.85 - 2004/06/14 =========================== - When solving a conflict KDiff3 reports the number of remaining unsolved conflicts in the status bar. Bugfixes: - Fix for MergeResultWindow-contextmenu: All items were disabled always. (new in 0.9.84) - Fix for problem when opening files specified relative to current directory. (new in 0.9.84, qt-only-version) - Fix for compilation with older gcc (2.9x) - Several Word-wrap problems fixed: - Find string with word wrap active didn't work if found text was not in first wrap-line. - overview-position was not updated when toggling word wrap - horizontal scrollbar was not updated when toggling word wrap - current selection was lost when toggling word wrap - selecting a conflict in the diff-text-window didn't work right with word wrap. - Qt-only: Bold attribute for fonts was not persistent - Qt-only: Toolbar position was not persistent - Qt-only: Language-choice shows also the full language name. - Cursor and windows-boundary-lines were always black instead of having the foreground color - Starting KDiff3 with two not existing files showed a dialog saying that files are binary equal. - Errors while starting a directory comparison now also reopens the open-dialog. - Speedup during directory comparison by avoiding unnecessary redraws. (These always creep in again :-() - On KDE: When resetting to default options (or first start) now the default KDE-fixed font will be used. - Mergeresultwindow: Improved behaviour after automatic merge operation. Version 0.9.84 - 2004/05/29 ============================ New Features: - Word Wrap for DiffTextWindow - Directory-Comparison: Option "Full Analysis" allows you to show the number of solved vs. unsolved conflicts or deltas vs. whitespace-changes in the directory tree. - Diff-Menu for Diff-view specific entries - Docs now contain a new chapter for uses of preprocessor and line-matching-preprocessor. - Added several credits which now are also visible in the Qt-only version. - The Qt-only version now also shows all command-line options. Under windows a dialog shows them. - Command line options -u and -L for Subversion-support. - Command line options --L1/2/3 for specifying alias names. - In the Qt-only-version the user-interface-language can be set via the regional-settings (only effective after a restart). - ProgressDialog redesign for recursive use. - Overview now allows you to show the delta between two other files in triplediff-mode. - Option to ignore case which treats case-changes like white space (instead of conversion to upcase). Bugfixes: - Dir-Comp: When one file exists, but the other doesn't then instead the latest used other file was displayed. - Open dialog: When previously a file C was used, but should be empty now, it reappeared unbidden. - Several bugs for 64-bit systems fixed. - Fixed crash when one file ended with a newline and the other did not. - Windows: Case insensitive filename-pattern matching. - Corrected behaviour for files with size 0. - Fix for crash due to a race-condition (Patch by Eike Sauer) - Windows: Scrolling didn't work right when another window was in front. - Mergeresultwindow didn't show correct position when starting a second or later merge. - Fix for problem where sometimes the A/B/C-buttons were in wrong state. - Pasting from selection via the middle mousebutton. Version 0.9.83 - 2004/03/06 =========================== - Reading directorys fixed for Win95/98 - Caseinsensitive filename matching for windows. - Autocopy to selection for systems that support this. (Patch by Stefan Partheymueller) - Drawing during recalc suppressed in merge result editor. - Cursor could go beyond last line in merge result editor. (Corrected NrOfLine-counting.) - Windows: Start with invalid cmd-line-options brings up a messagebox with the list of options. - Corrected encoding when copying to or pasting from clipboard. - Corrected char-by-char-diff at beginning of line. ("012345 12345 xyz" <-> "012345 xyz") - Warning when merging with preprocessor or upcase-conversion enabled. - Rewrite of preprocessing code should fix several problems. E.g.: - Ignore C/C++-comments only worked with a preprocessor active. - Preprocessor output now is input of line-matching preprocessor. - Paste to diff-window, didn't work if LMPP or Ignore C/C++-Comments was set. Version 0.9.82 - 2004/02/02 =========================== - DirectoryMerge: Running merge op for last item in a folder, performed the merge op for all following items in following folders. (Possible data loss!) - Fix: Preprocessors and "Ignore Comments" didn't work at the same time. - Fix: Preprocessors crashed with remote files. - Open-Dialog: When either input is changed, then reset the output to be empty. (To avoid accidental overwrites.) - Icon for "Highlight white space differences." - Editor-Option: Line End Style for saving: Dos/Windows "\r\n" vs. Unix "\n" - Merge output editor: Corrected wrong encoding for output-filename and user-typed characters. - Speedup for reading directories under Windows. - Enhanced progress dialog responsiveness during local file copy. - Fix for non-KDE-version: No URL-encoding when dropping files in open dialog. Version 0.9.81 - 2004/01/08 =========================== - Allow to compile with --enable-final - Bugfix for 3 file-compare (and A or B don't exist, crashed) - Bugfix for crash when second directory is merged - Some keyboard-shortcuts for selection of merge-operation didn't work correctly. - Shortcuts Ctrl-1/2/3 are possible in textmergewindow and in dirmergewindow, depending on the focus. - First steps towards internationalisation - Manpage doc/en/kdiff3.1 by Eike Sauer (for Debian) - Directory rescan shortcut SHIFT-F5 Version 0.9.80 - 2003/12/08 =========================== New Text Diff/Merge Features: - Now using GNU-diff algorithms internally. (Option "External Diff" removed.) - Option for treating C/C++ comments as whitespace during diff. - Bugfix for locale character encoding (+ new option "Use string encoding") - Option for suppressing highlighting in white-space changes. (Also suppresses highlighting in comments and numbers when the respective options are active.) - Merge-menu: Choose A/B/C for all unsolved conflicts. Choose A/B/C for all unsolved whitespace conflicts. - Options to automatically choose a certain source for whitespace conflicts. - Shorcut F5 now used to reload the current file. New Directory-Comparison/Merge Features: - Option to trust filesize. (Some directory services don't copy the date/time correctly.) - Shortcut F7 now starts complete directory merge (previously F5). - Do the selected merge operation for the selected file/dir only "Run Operation For Current Item" (F6). - Shortcuts for selecting the merge operation for the selected item. Ctrl-1/2/3/4/Del select A/B/C/Merge/Delete respectively. Other Improvements: - Several i18n-corrections (by Stephan Binner) - Bugfix for option CVS-ignore: Didn't work correctly in subdirectories. - Bugfix for remote operations: Operation can now be aborted, when KIO-slaves doesn't respond. - Cancel-Button in progress bar. - Default diff-view now again side by side instead of one above the other. Version 0.9.71 - 2003/10/17 =========================== - Windows-Installer by Sebastien Fricker. - Bugfixes for Windows. (Problems with setFont() in paintEvent().) - Default font for Windows now "Courier New" (instead of Courier) - Fix for compilation with gcc 2.95 - Support for Ctrl-Tab under Windows. - Fix for finding documentation. - Fix for problem with directory-sync-mode (new in 0.9.70). - Fix for several subsequent CR-characters in input file. Version 0.9.70 - 2003/09/28 =========================== - Transparent access to URLs via KIO (KDE only): Compare files and directories on ftp, fish, smb, tar etc. ressources. - Workaround for a Win32-bug (Crashed sometimes during selections) - When the merge flag is selected in the open dialog, the directory-tool always starts a merge by default for each file. Without the flag only a diff will be started by default. - Immediately showing progress bar in dir scan. - Showing progress bar for file comparison too. - Directory-menu: Fold/Unfold all subdirs - Bugfix for 3-way auto-merge: A line deleted from the base in B and C resulted in a empty line instead of being completely removed. - Improved locale support - KDiff3 is now a KPart - in KDevelop3 it can be used to compare the current text with the last saved version, or the current version on disk with the last cvs version. - in Konqueror it can be used to look at a unified *.patch-file if one complete version is available too. - Documentation is now in docbook-format. - "Toggle Split Orientation" for Diff-Input windows. (Good for long lines.) - When "Dir and Text Split-Screen-View" is off: Now "Focus Next/Prev Window" also toggles between dir and text-windows. Selecting a file via double click switches to text-screen. - KDiff3 displays a warning when trying to read a dir without the permission. - Directory-Diff-Option "Use CVS-Ignore" to ignore files like CVS does. - Displaying a status message at the end of the directory-comparison. - Cursor in MergeResultWindow is automatically placed at current difference when a jump occurred. (But not when something was selected.) - Fix for cursor blinking in the topline of the MergeResultWindow. Version 0.9.61 - 2003/06/07 =========================== - Compilation problem fixed. - Directory merge: Preserving file attributes and times during copy. (now also for Win32) - Crash fixed, when directory comparison from the command-line was started. Version 0.9.60 - 2003/06/01 =========================== New features: - New ways to select input for the diff window: - Pasting clipboard text into a diff window. - Drag and drop a file from a filemanager (e.g. konqueror) onto a diff window. - Drag and drop text from an editor (e.g. kate) onto a diff window. Reanalysis starts immediately if no merge is in progress. (This should help you to compare similar parts in the same file.) - New/Deleted white lines are now also considered as white deltas. - Configurable keyboard shortcuts for most actions (KDE version only). - The overview now also distinguishes whitespace deltas. New preprocessor options: - You can now define your own external Preprocessor and LineMatchingPreprocessor: - "Convert to upper case", - "Ignore numbers" Fixed bugs: - Directory merge: Preserving file attributes and times during copy. (not for Win32 yet) Source-tree-structure: - Switch to KDevelop3 (Gideon): Renamed subdir "kdiff3" to "src". - xpm-files in xpm-subdirectory. Version 0.9.51 - 2003/04/14 =========================== - Compilation fix for gcc 2.95. Version 0.9.50 - 2003/03/30 =========================== Fixed bugs: - Auto-Advance setting was lost when entering the settings-dialog. - Windows specific: Keys with AltGr-Combination didn't work. - Windows 95/98/ME: Fixed crash when KDiff3 is called used without parameters, and corrected support for external diff. New Features: - Search-function: Search for a string in all open text windows. - Special background colors for current region. - Button to toggle showing of whitespace in differences. - Buttons to go to next/prev unsolved (!) conflict. - While auto-advance waits, no more choices are allowed. - New setting: Auto-advance-delay. (Note that with delay 0 fast clicks might be detected as double clicks and the second click does nothing. My advice: Prefer the keyboard-shortcuts Ctrl-1/2/3) - Functions to Show/Hide Diff Window A, B or C. The other windows then have more space. - Merge editor: The right mouse button selects the current region and lets you choose A, B or C via a popup menu. - Commandline option --auto: No GUI if all conflicts are auto-solvable. - When equal files are compared, then a message box informs you. - Merge current file: When comparing two or three files, the merge can be started with a single click. - Option dialog: Warning for "Defaults" added, because it resets all options. - A warning is given, when the user tries to merge binary files. (i.e. files that contain '\0'-bytes) Changed behaviour: - 3 file automerge: When for a line B==C (and A!=B) then C will be selected. (In older versions this was a conflict. I was convinced that this is no problem.) - Auto-Advance now jumps to next unsolved (!) conflict. - On 256-color-displays KDiff3 uses them. (Previously KDiff3 only used 16 colors.) - On 16-color-displays the Defaults-button in the options dialog selects special colors. Version 0.941 - 2003/02/09 ========================== Fixed bugs: - Qt-only-version: Compile problem corrected. - Documentation: Formatting for tables corrected. Version 0.94 - 2003/02/09 ========================= New features: - Option to use external GNU-diff for line matching. (Sometimes GNU-diff is better, sometimes not: You may choose now.) - In diff-windows a tooltip shows the full path if you move the mouse on the filename. - Speedup of directory-merge operations without user interaction. (Not every item in the tree is made visible anymore. This took too long.) - When opening a file for comparison or merge KDiff3 immediately shows the first difference. - "Go To Top/Bottom"-action have been changed to "Go To First/Last Delta". - Font-Option "Italic For Deltas" added. - Many icons and actions will only be enabled, when the operation is possible. - Icon for merge of current file in directory merge mode added. - New action "Go to Current Delta". - Conflicts where some lines contained only-white-space-changes are now separated from other non-white-space-conflicts. - Experimental: Use as replacement for ClearCase-cleardiffmrg.exe (under Windows only). See main.cpp for details. Fixed bugs: - If files were different, but had the same dates, the "not existant"-icon was shown for one file. Now a error message will be shown if the option "Copy newer instead of merging" is used. - Documentation: Section "The Operation Column" corrected. - Qt-only-version: Fontsize wasn't correctly restored. - Keyboard accelerators didn't work for ToggleActions. Version 0.931 - 2003/01/19 ========================== Fix for compilation problems with gcc version < 3. Version 0.93 - 2003/01/16 ========================= New features: - Directory comparison and merge. (More than 3000 new lines of code only here!!!) - Open-Dialog: Filename specification: If no previous filename is there then start directory is taken from another file. - Message about number of found and automatically solved conflicts. - Support for wheelmouse based scrolling. - New option in Diff-tab: Preserve Carriage Return Characters Fixed bugs: - Save button disabled until all conflicts are solved. - Copy-operation conserves conflict messages "". - Paste operation created pseudo conflicts when the clipboard contained empty lines. - W95/98/ME specific program crash removed. Version 0.92 - 2002/11/04 ========================= Severe bug corrected: - Merge menu: Choose A/B/C Everywhere sometimes lost data. (introduced in 0.9) Version 0.91 - 2002/11/03 ========================= Speed improvements for very big/complicated files: - Faster analysis because of limited search range (can be adjusted). - Faster scrolling and editor behaviour. Fixed bugs: - Compilation problem with gcc 3.2 fixed. - When comparing two lines, matching spaces often were undetected. - Merge editor appended extra empty line when saving. - Sometimes the next diff/conflict wasn't made visible. - The Auto-Advance setting is saved now. - When doing a merge the application now has modified-state, even without further input. (The old method wasn't safe.) - File selection now always in directory of respective file. Version 0.9 - 2002/10/16 ======================== New features: - Qt-only support. Allows compilation under KDE2, Gnome, Mac, Windows, ... Note that KDE3 still gets special treatment. - For Mergers: Auto-Advance after selection, Choose A/B/C everwhere, ... - Commandline: If files with same name in different directories are compared, only the first parameter needs the filename. - Shift-Del, Ctrl-Ins, Shift-Ins supported for Cut/Copy/Paste Fixed bugs: - Make failed on some systems because of missing "minmax.h". - Files where opened for reading, but not closed afterwards. - Vertical scrollbar sometimes didn't work correctly. Version 0.81 - 2002/08/18 ========================= New features: - Now KDE3 is also supported. Previously only KDE2 was supported. - Navigation via click into the overview column now supported. Fixed bugs: - Some input files caused a crash in the diff-algorithm. - The meaning of option "Ignore trivial matches" was inverted. - When selecting a text in one window, this deselects any previously active selection in the same or another window. Version 0.8 - 2002/07/28 ======================== This is the first version to be released. diff --git a/README b/README index 2ef8736..58099ac 100644 --- a/README +++ b/README @@ -1,110 +1,100 @@ KDiff3-Readme ============= Author: Joachim Eibl (joachim.eibl at gmx.de) Port to KF5/Qt5 by Michael Reeves (reeves.87@gmail.com) -KDiff3-Version: 1.7 +KDiff3-Version: 1.7.90 Now requires Qt 5.6 or later and KF5 5.14+. Legacy 0.9.98 and earlier builds are not supported. -Windows/MacOSX build is untested since port. Builds and runs under kubuntu 16.04 will likely -still work under other Linux/Un*x. The Konqueror specific plugin is not ported and no longer mantained. +MacOSX build is untested since port. The Konqueror specific plugin is not ported and no longer mantained. This plugin would only apply to KDE before 4.6. Support as been removed from main CMakeLists.txt. As of 1/13/17 cmake 3.1+ is the targeted cmake version. cmake is now the only build system supported. KF5/QT5 was big jump. A lot changed besides just the API. I am not against a Qt5-only build variant but see no reason to mantain two sperate build systems. At present KF5 is my focus. The original pre KF5/Qt5 Readme fallows old build intrustions have been removed to avoid confusion: Copyright: (C) 2002-2014 by Joachim Eibl -KDiff3-Version: 0.9.98 KDiff3 runs best on KDE but can be built without it, depending only on Qt-libs. These are available for Un*x, Windows, Mac. Thus there are many setup possibilities to consider. Supported Qt-versions: 4.8, 5.2 or higher. Supported KDE-version: 4 (For KDE3/Qt3 use KDiff3-0.9.92 or older.) Contents -------- - Introduction - License -- Requirements & Installation - - For KDE4 - - With Qt4-libs, without KDE - - for Linux/Un*x - - for Windows - - Debugging with MinGW under Windows: - - for Mac: Building KDiff3 for Mac OSX (with Intel processor) as a universal binary - - Creating and installing translation messages - Additional hints Introduction ------------ KDiff3 is a program that - compares and merges two or three input files or directories, - shows the differences line by line and character by character (!), - provides an automatic merge-facility and - an integrated editor for comfortable solving of merge-conflicts - has support for KDE-KIO (ftp, sftp, http, fish, smb), - has an intuitive graphical user interface, - provides a context menu for KDE-Konqueror and Windows-Explorer, - supports 64 bit systems. (Some build issues are discussed in here.) - Support for many encodings and Unicode. Do you want help translating? Read the README in the po-subdirectory! License ------- GNU GENERAL PUBLIC LICENSE, Version 2, June 1991 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307 USA For details see file "COPYING". ------------------------------------------------------------------------ Additional hints ---------------- Start from commandline: - Comparing 2 files: kdiff3 file1 file2 - Merging 2 files: kdiff3 file1 file2 -o outputfile - Comparing 3 files: kdiff3 file1 file2 file3 - Merging 3 files: kdiff3 file1 file2 file3 -o outputfile Note that file1 will be treated as base of file2 and file3. If all files have the same name but are in different directories, you can reduce typework by specifying the filename only for the first file. E.g.: - Comparing 3 files: kdiff3 dir1/filename dir2 dir3 (This also works in the open-dialog.) If you start without arguments, then a dialog will appear where you can select your files via a filebrowser. For more documentation, see the help-menu or the subdirectory doc. Have fun! diff --git a/doc/en/index.docbook b/doc/en/index.docbook index 2519f7e..3881014 100644 --- a/doc/en/index.docbook +++ b/doc/en/index.docbook @@ -1,2072 +1,2072 @@ KDiff3"> ]> The &kdiff3; Handbook Joachim Eibl
joachim.eibl at gmx.de
2002-2007 Joachim Eibl 2017 Michael Reeves &FDLNotice; 2018-04-30 1.07.00 &kdiff3; is a file and directory diff and merge tool which compares and merges two or three text input files or directories, shows the differences line by line and character by character(!), provides an automatic merge-facility, has an editor for comfortable solving of merge-conflicts, provides networktransparency via KIO, has options to highlight or hide changes in white-space or comments, supports Unicode, UTF-8 and other file encodings, prints differences, supports version control keyword and history merging. - This document describes &kdiff3;-version 1.7.0. + This document describes &kdiff3;-version 1.7.90. KDE kdiff3 diff merge CVS triplediff compare files directories version control three-way-merge in-line-differences synchronise kpart kio networktransparent editor white space comments
Introduction Yet Another Diff Frontend? Several graphical diff tools exist. Why choose &kdiff3;? Let me say, why I wrote it. &kdiff3; started because I had to do a difficult merge. Merging is necessary when several people work on the same files in a project. A merge can be somewhat automated, when the merge-tool not only has the new modified files (called "branches"), but also the original file (called "base"). The merge tool will automatically choose any modification that was only done in one branch. When several contributors change the same lines, then the merge tool detects a conflict which must be solved manually. The merge then was difficult because one contributor had changed many things and corrected the indentation in many places. Another contributor also had changed much text in the same file, which resulted in several merge conflicts. The tool I used then, only showed the changed lines, but not what had changed within these lines. And there was no information about where only the indentation was changed. The merge was a little nightmare. So this was the start. The first version could show differences within a line and showed white space differences. Later many other features were added to increase the usefulness. For example if you want to compare some text quickly, then you can copy it to the clipboard and paste it into either diff window. A feature that required a big effort was the directory comparison and merge facility, which turned the program almost into a full file browser. I hope &kdiff3; works for you too. Have fun! Joachim Eibl (2003) Screenshots and Features This screenshot shows the difference between two text files (Using an early version of &kdiff3;): 3-way-merging is fully supported. This is useful if two people change code independently. The original file (the base) is used to help &kdiff3; to automatically select the correct changes. The merge-editor below the diff-windows allows you to solve conflicts, while showing you the output you will get. You can even edit the output. This screenshot shows three input files being merged: &kdiff3; also helps you to compare and merge complete directories. This screenshot shows &kdiff3; during a directory merge: More Features Line-By-Line And Char-By-Char Diff-Viewer By using the possibilities of a graphical color display &kdiff3; shows exactly what the difference is. When you have to do many code-reviews, you will like this. See White-Space Differences At One Glance Spaces and tabs that differ appear visibly. When lines differ only in the amount of white space this can be seen at one look in the summary column on the left side. (No more worries when people change the indentation.) Triple-Diff Analyze three files and see where they differ. The left/middle/right windows are named A/B/C and have the blue/green/magenta color respectively. If one file is the same and one file is different on a line then the color shows which file is different. The red color means that both other files are different. Comfortable Merge Of Two Or Three Input Files &kdiff3; can be used to merge two or three input files and automatically merges as much as possible. The result is presented in an editable window where most conflicts can be solved with a single mouseclick: Select the buttons A/B/C from the button-bar to select the source that should be used. You can also select more than one source. Since this output window is an editor even conflicts which need further corrections can be solved here without requiring another tool. And ... Fast navigation via buttons. A mouse-click into a summary column sync's all windows to show the same position. Select and copy from any window and paste into the merge result window. Overview column that shows where the changes and conflicts are. The colors are adjustable to your specific preferences. Adjustable Tab size. Option to insert spaces instead of tabs. Open files comfortably via dialog or specify files on the command line. Search for strings in all text windows. Find (Ctrl-F) and Find Next (F3) Show the line numbers for each line. Paste clipboard or drag text into a diff input window. Networktransparency via KIO. Can be used as diff-viewer in KDevelop 3. Word-wrap for long lines. Support for Unicode, UTF-8 and other codecs. Support for right to left languages. ... File Comparison And Merge Command-Line Options Comparing 2 files: kdiff3 file1 file2 Merging 2 files: kdiff3 file1 file2 -m kdiff3 file1 file2 -o outputfile Comparing 3 files: kdiff3 file1 file2 file3 Merging 3 files: kdiff3 file1 file2 file3 -m kdiff3 file1 file2 file3 -o outputfile Note that file1 will be treated as base of file2 and file3. Special case: Files with the same name If all files have the same name but are in different directories, you can reduce typework by specifying the filename only for the first file. E.g.: kdiff3 dir1/filename dir2 dir3 Commandline for starting a directory comparison or merge: This is very similar, but now it's about directories. kdiff3 dir1 dir2 kdiff3 dir1 dir2 -o destdir kdiff3 dir1 dir2 dir3 kdiff3 dir1 dir2 dir3 -o destdir For directory comparison and merge you can continue to read here. Other command line options To see all available command line options type kdiff3 --help Example output: Options: -m, --merge Merge the input. -b, --base file Explicit base file. For compatibility with certain tools. -o, --output file Output file. Implies -m. E.g.: -o newfile.txt --out file Output file, again. (For compatibility with certain tools.) --auto No GUI if all conflicts are auto-solvable. (Needs -o file) --qall Don't solve conflicts automatically. (For compatibility...) --L1 alias1 Visible name replacement for input file 1 (base). --L2 alias2 Visible name replacement for input file 2. --L3 alias3 Visible name replacement for input file 3. -L, --fname alias Alternative visible name replacement. Supply this once for every input. --cs string Override a config setting. Use once for every setting. E.g.: --cs "AutoAdvance=1" --confighelp Show list of config settings and current values. --config file Use a different config file. The option allows you to adjust a configuration value that is otherwise only adjustable via the configure dialogs. But be aware that when &kdiff3; then terminates the changed value will be stored along with the other settings. With you can find out the names of the available items and current values. Via you can specify a different config file. When you often use &kdiff3; with completely different setups this allows you to easily switch between them. Ignorable command line options Many people want to use &kdiff3; with some version control system. But when that version control system calls &kdiff3; using command line parameters that &kdiff3; doesn't recognise, then &kdiff3; terminates with an error. The integration settings allow to specify command line parameters that should be ignored by &kdiff3;. They will appear in the usage help like in this example: --foo Ignored. (User defined.) Command line options to ignore: A list of options, separated via semicolon ';'. When one of these options appears on the commandline, then &kdiff3; will ignore it and run without reporting an error. (Default is "u;query;html;abort"). When this isn't enough, then it is recommended to write a shell script that does the option translation. Open-Dialog Since many input files must be selectable, the program has a special open dialog: The open dialog allows you to edit the filenames by hand, selecting a file via the file-browser ("File...") or allows you to choose recent files from the drop-down lists. If you open the dialog again, then the current names still remain there. The third input file is not required. If the entry for "C" remains empty, then only a two file diff analysis will be done. You can also select a directory via "Dir...". If for A a directory is specified then a directory-comparison/merge starts. If A specifies a file but B, C or the output specify a directory, then &kdiff3; uses the filename from A in the specified directories. If "Merge" is selected, then the "Output"-line becomes editable. But it is not required to specify the output filename immediately. You can also postpone this until saving. The "Configure..."-button opens the options-dialog, so that you can set the options before running the analysis. Paste and Drop Input Sometimes you want to compare parts of a text that is not an own file. &kdiff3; also allows you to paste text from the clipboard into the diff input window that has the focus. The diff analysis happens immediately then. In the open dialog you need not specify files then, but just close it via "Cancel". You can also use drag and drop: Drag a file from a file manager or selected text from an editor and drop it onto a diff input window. What's the idea? Sometimes a file contains two similar functions, but checking how similar they really are is a big effort if you first must create two files and then load them. Now you can simply copy, paste and compare the relevant sections. Note: Currently you cannot drag anything from &kdiff3;. Only dropping in the diff input is supported. Warning: Some editors still interpret the drag and drop into another program like cut (instead of copy) and paste. Your original data might be lost then. Comparing Files And Interpreting The Information In The Input Windows Info Line At the top of each text window is its "info line". The info lines of the input windows contain a letter "A", "B" or "C", the editable filename, a button for browsing, and the line number of the first visible line in the window. (Note that window "C" is optional.) Each info line appears in a different color. When you selected another file via browsing or finished editing the filename here by pressing enter, the new file will be loaded and compared with the already loaded file(s). Coloring The three input windows are assigned the letters "A", "B" and "C". "A" has color blue, "B" has green and "C" has magenta. (These are the defaults, but can be changed in the Settings-Menu.) When a difference is detected then the color shows which input file differs. When both other input files differ then the color used to express this is red by default ("Conflict color" in the Settings). This colorscheme is especially useful in the case of three input files, which will be seen in the next section (Merging). Summary Column Left of each text is the "summary column". If differences occurred on a line then the summary column shows the respective color. For a white-space-only difference the summary is chequered. For programming languages where white space is not so important this is useful to see at one glance if anything of importance was modified. (In C/C++ white space is only interesting within strings, comments, for the preprocessor, and some only very esoteric situations.) The vertical line separating the summary column and the text is interrupted if the input file had no lines there. When word-wrap is enabled then this vertical line appears dotted for wrapped lines. Overview Column On the right side a "overview"-column is visible left of the vertical scrollbar. It shows the compressed summary column of input "A". All the differences and conflicts are visible at one glance. When only two input windows are used, then all differences appear red here because every difference is also a conflict. A black rectangle frames the visible part of the inputs. For very long input files, when the number of input lines is bigger than the height of the overview column in pixels, then several input lines share one overview line. A conflict then has top priority over simple differences, which have priority over no change, so that no difference or conflict is lost here. By clicking into this overview column the corresponding text will be shown. Manually Aligning Lines Sometimes the algorithm places the wrong lines next to each other. Or you want to compare one piece of text with text at a completely different position in the other file. For these situations you can manually instruct &kdiff3; to align certain lines. Mark the text for which you want to improve the alignment with the mouse as you would for copy and paste in the first diff view and then choose "Add Manual Diff Alignment" in the "Diffview"-menu (keyboard shortcut &Ctrl;Y). An orange bar will appear in the summary column next to the chosen text. Repeat this for the second and (if available) third diff view. &kdiff3; will immediately recalculate the differences everytime you do this, and will align the chosen lines. Of course some of the previously matching lines in between might not match anymore. Currently merging doesn't support the use of manual diff help. Manually Joining and Splitting Diff Sections In some cases &kdiff3; will see too many or too few diff sections for merging. In such a case you can join or split existing sections. Add new sections by first selecting text in the lines that belong together in either input window (as for copying to the clipboard). Then choose "Split Diff At Selection" in the "Merge" menu. Splits will be added above the first line and below the last line of the selected text. If you only want to add one section, then select text beginning at another section-split. For joining sections in either input window select something in the lines from the sections to join. (You can join several sections in one step too.) Then choose "Join selected Diffs" in the "Merge"-menu. Merging And The Merge Output Editor Window The merge output editor window (below the diff input windows) also has an info line at the top showing "Output:", the filename and "[Modified]" if you edited something. Usually it will contain some text through the automatic merge facilities, but often it will also contain conflicts. !!! Saving is disabled until all conflicts are resolved !!! (Use the "Go to prev/next unsolved conflicts"-buttons to find the remaining conflicts.) With only two input files every difference is also a conflict that must be solved manually. With three input files the first file is treated as base, while the second and third input files contain modifications. When at any line only either input B or input C have changed but not both then the changed source will automatically be selected. Only when B and C have changed on the same lines, then the tool detects a conflict that must be solved manually. When B and C are the same, but not the same as A, then C is selected. The Summary Column The merge output editor window also has a summary column on the left. It shows the letter of the input from which a line was selected or nothing if all three sources where equal on a line. For conflicts it shows a questionmark "?" and the line shows "<Merge Conflict>", all in red. Because solving conflicts line by line would take very long, the lines are grouped into groups that have the same difference and conflict characteristics. But only-white-space-conflicts are separated from non-white-space-conflicts in order to ease the merging of files were the indentation changed for many lines. Setting The Current Group And Synchronising Merge And Diff View Position When clicking into the summary column with the left mouse button in either window then the beginning of the group belonging to that line will shown in all windows. This group then becomes the "current group". It is highlighted with the "Current range (diff) background color" and a black bar appears on the left side of the text. Choosing Inputs A, B or C For Current Conflict And Editing The button bar below the menubar contains three input selector buttons containing the letters "A", "B" and "C". Click the input selector button to insert (or remove if already inserted) the lines from the respective source. To choose the lines from several inputs click the respective buttons in the needed order. For example if you want that the lines from "B" appear before the lines from "A" in the output, first click "B", then "A". If you use the auto-advance option ("Automatically go to next unsolved conflict after source selection"), you should disable this before choosing lines from several inputs or if you want to edit the lines after your choice. Otherwise &kdiff3; will jump to the next conflict after choosing the first input. It is often helpful directly edit the merge output. The summary column will show "m" for every line that was manually modified. When for instance the differences are aligned in a way that simply choosing the inputs won't be satisfactory, then you can mark the needed text and use normal copy and paste to put it into the merge output. Sometimes, when a line is removed either by automatic merge or by editing and no other lines remain in that group, then the text <No src line> will appear in that line. This is just a placeholder for the group for when you might change your mind and select some source again. This text won't appear in the saved file or in any selections you want to copy and paste. The text "<Merge Conflict>" will appear in the clipboard if you copy and paste some text containing such a line. But still be careful to do so. Choosing Input A, B, or C for All Conflicts The normal merge will start by solving simple conflicts automatically. But the "Merge"-menu provides some actions for other common needs. If you have to select the same source for most conflicts, then you can choose "A", "B" or "C" everywhere, or only for the remaining unsolved conflicts, or for unsolved white space conflicts. If you want to decide every single delta yourself, you can "Set deltas to conflicts". Or if you want to return to the automatic choices of &kdiff3; then select "Automatically solve simple conflicts". &kdiff3; then restarts the merge. For actions that change your previous modifications &kdiff3; will ask for your confirmation before proceeding. Note: When choosing either source for unsolved white space conflicts and the options "Ignore Numbers" or "Ignore C/C++ Comments" are used then changes in numbers or comments will be treated like white space too. Automatic Merge of Version Control Keywords and History (Log) Many version control systems support special keywords in the file. (e.g. "$Date$", "$Header$", "$Author$", "$Log$" etc.) During the check-in the version control system (VCS) changes these lines. For instance "$Date$" will turn into "$Date: 2005/03/22 18:45:01 $". Since this line will be different in every version of the file, it would require manual interaction during the merge. &kdiff3; offers automatic merge for these items. For simple lines that match the "Auto merge regular expression"-option in all input-files &kdiff3; will choose the line from B or - if available - from C. (Additionally it is necessary that the lines in question line up in the comparison and the previous line contains no conflict.) This auto merge can either be run immediately after a merge starts (activate the option "Run regular expression auto merge on merge start") or later via the merge menu "Run Regular Expression Auto Merge". Automatic merge for version control history (also called "log") is also supported. The history automerge can either run immediately when the merge starts by activating the option "Merge version control history on merge start" or later via the merge menu "Automatically Solve History Conflicts". Usually the version control history begins with a line containing the keyword "$Log$". This must be matched by the "History start regular expression"-option. &kdiff3; detects which subsequent lines are in the history by analysing the leading characters that came before the "$Log$"-keyword. If the same "leading comment"-characters also appears in the following lines, then they are also included in the history. During each check-in the VCS writes a unique line specifying version-, date- and time-information followed by lines with user comments. These lines form one history-entry. This history section grows with every check-in and the most recent entries appear at the top (after the history start line). When for parallel development two or more developers check-in a branch of the file then the merge history will contain several entries that appear as conflicts during the merge of the branches. Since merging these can become very tedious, &kdiff3; offers support with two possible strategies: Just insert the history information from both contributors at the top or sort the history information by a user defined key. The just-insert-all-entries-method is easier to configure. &kdiff3; just needs a method to detect, which lines belong to one history entry. Most VCS insert an empty line after each history entry. If there are no other empty lines, this is a sufficient criterion for &kdiff3;. Just set an empty "History entry start regular expression". If the empty line criterion isn't sufficient, you can specify a regular expression to detect the history entry start. Note that &kdiff3; will remove duplicate history entries. If a history entry appeared several times in the history of a input file, only one entry will remain in the output. If you want to sort the history, then you have to specify how the sort key should be built. Use parentheses in the "History entry start regular expression" to group parts of the regular expression that should later be used for the sort key. Then specify the "History entry start sort key order" specifying a comma "," separated list of numbers referring to the position of the group in the regular expression. Because this is not so easy to get right immediately, you are able to test and improve the regular expressions and key-generation in a dedicated dialog by pressing the "Test your regular expressions"-button. Example: Assume a history that looks like this: /************************************************************************** ** HISTORY: $Log: \toms_merge_main_view\MyApplication\src\complexalgorithm.cpp $ ** ** \main\integration_branch_12 2 Apr 2001 10:45:41 tom ** Merged branch simon_branch_15. ** ** \main\henry_bugfix_branch_7\1 30 Mar 2001 19:22:05 henry ** Improved the speed for subroutine convertToMesh(). ** Fixed crash. **************************************************************************/ The history start line matches the regular expression ".*\$Log.*\$.*". Then follow the history entries. The line with the "$Log$"-keyword begins with two "*" after which follows a space. &kdiff3; uses the first non-white-space string as "leading comment" and assumes that the history ends in the first line without this leading comment. In this example the last line ends with a string that also starts with two "*", but instead of a space character more "*" follow. Hence this line ends the history. If history sorting isn't required then the history entry start line regular expression could look like this. (This line is split in two because it wouldn't fit otherwise.) \s*\\main\\\S+\s+[0-9]+ (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9][0-9][0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\s+.* For details about regular expressions please see the regular expression documentation by Trolltech. Note that "\s" (with lowercase "s") matches any white space and "\S" (with uppercase "S") matches any non-white-space. In our example the history entry start contains first the version info with reg. exp. "\\main\\\S+", the date consisting of day "[0-9]+", month "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)" and year "[0-9][0-9][0-9][0-9]", the time "[0-9][0-9]:[0-9][0-9]:[0-9][0-9]" and finally the developers login name ".*". Note that the "leading comment"-characters (in the example "**") will already be removed by &kdiff3; before trying to match, hence the regular expression begins with a match for none or more white-space characters "\s*". Because comment characters can differ in each file (e.g. C/C++ uses other comment characters than a Perl script) &kdiff3; takes care of the leading comment characters and you should not specify them in the regular expression. If you require a sorted history. Then the sortkey must be calculated. For this the relevant parts in the regular expression must be grouped by parentheses. (The extra parentheses can also stay in if history sorting is disabled.) \s*\\main\\(\S+)\s+([0-9]+) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([0-9][0-9][0-9][0-9]) ([0-9][0-9]:[0-9][0-9]:[0-9][0-9])\s+(.*) The parentheses now contain 1. version info, 2. day, 3. month, 4. year, 5. time, 6. name. But if we want to sort by date and time, we need to construct a key with the elements in a different order of appearance: First the year, followed by month, day, time, version info and name. Hence the sortkey order to specify is "4,3,2,5,1,6". Because month names aren't good for sorting ("Apr" would be first) &kdiff3; detects in which order the month names were given and uses that number instead ("Apr"->"04"). And if a pure number is found it will be transformed to a 4-digit value with leading zeros for sorting. Finally the resulting sort key for the first history entry start line will be: 2001 04 0002 10:45:41 integration_branch_12 tom For more information also see Merge Settings. Navigation And Editing Much navigation will be done with the scroll bars and the mouse but you can also navigate with the keys. If you click into either window then you can use the cursor buttons left, right, up, down, page up, page down, home, end, ctrl-home, ctrl-end as you would in other programs. The overview-column next to the vertical scroll bar of the input files can also be used for navigating by clicking into it. You can also use the wheel mouse to scroll up and down. In the merge output editor you can also use the other keys for editing. You can toggle between insert and overwrite mode with the insert key. (Default is insert-mode.) A left-mouse-button-click into any summary column will synchronise all windows to show the beginning of the same group of lines (as explained in section "Setting The Current Group And Synchronising Merge And Diff View Position"). The button bar also contains nine navigation buttons with which you can jump to the current/first/last difference, to the next/previous difference (ctrl-down/ctrl-up), to the next/previous conflict (ctrl-pgdown/ctrl-pgup), or to the next/previous unsolved conflict. Note that for &kdiff3; a "conflict" that was not automatically solved at the start of the merge stays a "conflict" even if it is solved. Hence the necessity to distinguish "unsolved conflicts". Auto-Advance There also is a button "Automatically go to next unsolved conflict after source selection" (Auto-Advance). If you enable this, then, when one source is selected, &kdiff3; will jump to and select the next unsolved conflict automatically. This can help when you always want to choose one source only. When you need both sources, or you want to edit after selecting, then you probably want to switch this off. Before proceeding to the next unsolved conflict &kdiff3; shows you the effect of your choice for a short time. This delay is adjustable in the Diff- & Merge-Settings: You can specify the "Auto-Advance delay" in milli seconds between 0 and 2000. Hint: Tired of many clicks? - Use a small Auto-Advance-delay and the shortcuts Ctrl-1/2/3 to select A/B/C for many conflicts. Select, Copy And Paste The input windows don't show a cursor, so selections must be made with the mouse by clicking with the left mouse button at the start, holding down the mousebutton and moving to the end, where you release the mouse button again. You can also select a word by double clicking it. In the merge output editor you can also select via the keyboard by holding the "shift"-button and navigation with the cursor keys. If the selection exceeds the visible range you can move the mouse over the window borders which causes &kdiff3; to scroll in that direction. For very large selections you can also use the navigation keys while holding down the mouse. E.g. use page up and page down to quickly go to a certain position. At the end position release the mouse button. In order to select everything in the current window use menu "Edit"->"Select All" (Ctrl-A). To copy to the clipboard you must press the "Copy"-button (Ctrl-C or Ctrl-Insert). But there exists an option "Auto Copy Selection". If this is enabled, then whatever you select is copied immediately and you don't need to explicitly copy. But pay attention when using this because the contents of the clipboard might then be destroyed accidentally. "Cut" (Ctrl-X or Shift-Delete) copies to the clipboard and deletes the selected text. "Paste" (Ctrl-V or Shift-Insert) inserts the text in the clipboard at the cursorposition or over the current selection. If you paste to either diff input window the contents of the clipboard will be shown in that window and the comparison will restart immediately. This is useful if you want to quickly grab a piece of text from somewhere and compare it with something else without first creating files. Saving Saving will only be allowed, when all conflicts were solved. If the file already exists and the "Backup files"-option is enabled then the existing file will be renamed with an ".orig"-extension, but if such a file exists it will be deleted. When you exit or start another diff-analysis and data wasn't saved yet, then &kdiff3; will ask if you want to save, cancel or proceed without saving. (&kdiff3; does not catch any signals. So if you "kill" &kdiff3; then your data will be lost.) Line endings are saved according to the normal method on the underlying operating system. For Unices each line ends with an linefeed-character "\n", while for Win32-based systems each line ends with a carriage-return + a linefeed "\r\n". &kdiff3; does not preserve the line-endings of the input files, which also means that you shouldn't use &kdiff3; with binary files. Finding Strings You can search for a string in any text-window of &kdiff3;. The "Find ..."-command (Ctrl-F) in the Edit-menu opens a dialog that lets you specify the string to search for. You can also select the windows which should be searched. Searching will always start at the top. Use the "Find Next"-command (F3) to proceed to the next occurrence. If you select to search several windows then the first window will be searched from top to bottom before the search starts in the next window at the top again, etc. Printing &kdiff3; supports printing for textfile differences. The "Print..."-command (Ctrl-P) in the File-menu opens a dialog that allows you to select the printer and to adjust other options. There are several possibilities to adjust the range. Due to different printing dialogs on different operating systems, the method to achieve certain range selections varies. All:Print everything. Current:Print a page starting at the first visible line in the window. (On systems without this option this can be achieved by specifying page number 10000 for printing.) Selection: Before choosing to print select text with the mouse (like for copy and paste) in one of the diff input windows to define the start and end line. If no text in one of the diff input windows was selected, then this won't be an available choice. (On systems without this option this can be achived by specifying page number 9999 for printing.) Range:Specify the first and last page. Other important options for printing will be taken from the normal options: Font, font size Show line numbers Word wrap Colors etc. Landscape formatting is also recommended for printing. Options Options and the recent-file-list will be saved when you exit the program, and reloaded when you start it. (Menu Settings->Configure &kdiff3; ...) Font Select a fixed width font. (On some systems this dialog will also present variable width fonts, but you should not use them.) Italic Font for Deltas: If you select this, then text differences will be drawn with the italic version of the selected font. If the font doesn't support italic, then this does nothing. Colors Foreground color: Usually black. Background color: Usually white. Diff Background color: Usually light gray. Color A: Usually dark blue. Color B: Usually dark green. Color C: Usually dark magenta. Conflict Color: Usually red. Current range background color: Usually light yellow. Current range diff background color: Usually dark yellow. Color for manually selected diff ranges: Usually orange. Newest file color in directory comparison: Usually green. Oldest file color in directory comparison: Usually red. Middle age file color in directory comparison: Usually dark yellow. Color for missing files in directory comparison: Usually black. Changing the colors for directory comparison will be effective only when starting the next directory comparison. On systems with only 16 or 256 colors some colors are not available in pure form. On such systems the "Defaults"-button will choose a pure color. Editor Settings Tab inserts spaces: If this is disabled and you press the tabulator key, a tab-character is inserted, otherwise the appropriate amount of characters is inserted. Tab size: Can be adjusted for your specific needs. Default is 8. Auto indentation: When pressing Enter or Return the indentation of the previous line is used for the new line. Auto copy selection: Every selection is immediately copied to the clipboard when active and you needn't explicitly copy it. Line end style: When saving you can select what line end style you prefer. The default setting is the common choice for the used operating system. Diff Settings When comparing files, &kdiff3; first it tries to match lines that are equal in all input files. Only during this step it might ignore white space. The second step compares each line. In this step white space will not be ignored. Also during the merge white space will not be ignored. Ignore numbers: Default is off. Number characters ('0'-'9', '.', '-') will be ignored in the first part of the analysis in which the line matching is done. In the result the differences will be shown nevertheless, but they are treated as white space. Ignore C/C++ comments: Default is off. Changes in comments will be treated like changes in white space. Ignore case: Default is off. Case-differences of characters (like 'A' vs. 'a') will be treated like changes in white space. Preprocessor-Command: See next section. Line-Matching Preprocessor-Command: See next section. Try Hard: Try hard to find an even smaller delta. (Default is on.) This will probably be effective for complicated and big files. And slow for very big files. Merge Settings Auto Advance Delay (ms): When in auto-advance-mode this setting specifies how long to show the result of the selection before jumping to the next unsolved conflict. White space 2/3-file merge default: Automatically solve all white-space conflict by choosing the specified file. (Default is manual choice.) Useful if white space really isn't important in many files. If you need this only occasionally better use "Choose A/B/C For All Unsolved Whitespace Conflicts" in the merge menu. Note that if you enable either "Ignore numbers" or "Ignore C/C++ comments" then this auto-choice also applies for conflicts in numbers or comments. Auto merge regular expression: Regular expression for lines where &kdiff3; should automatically choose one source. See also Automatic Merge ... Run regular expression auto merge on merge start: If activated &kdiff3; runs the automatic merge using the "Auto merge regular expression" when a merge is started. History start regular expression: Regular expression for the start of the merge history entry. Usually this line contains the "$Log$"-keyword. Default value: ".*\$Log.*\$.*" History entry start regular expression: A merge history entry consists of several lines. Specify the regular expression to detect the first line (without the leading comment). Use parentheses to group the keys you want to use for sorting. If left empty, then &kdiff3; assumes that empty lines separate history entries. See also Automatic Merge ... History merge sorting: Enable version control history sorting. History entry start sort key order: Each parentheses used in the regular expression for the history start entry groups a key that can be used for sorting. Specify the list of keys (that are numbered in order of occurrence starting with 1) using ',' as separator (e.g. "4,5,6,1,2,3,7"). If left empty, then no sorting will be done. See also Automatic Merge ... Merge version control history on merge start: If activated &kdiff3; runs the automatic history merging using aforementioned options when a merge is started. Max number of history entries: &kdiff3; truncates the history list after the specified number of entries. Use -1 to avoid truncation. (Default is -1). Test your regular expressions This button shows a dialog that allows you to improve and test the regular expressions above. Just copy the respective data from your files into the example lines. The "Match results" will immediately show whether the match succeeds or not. The "Sort key result" will display the key used for history merge sorting. Irrelevant merge command: Specify a command of your own that should be called when &kdiff3; detects that for a three file merge the file from B doesn't contribute any relevant data that isn't already contained in the file from C. The command is called with the three filenames as parameters. Data matched by the "Auto merge regular expression" or in the history isn't considered relevant. Directory Merge These options are concerned with scanning the directory and handling the merge: See the Directory Comparison/Merge Docs for details. Yet there is one option here that is also relevant for saving single files: Backup files: When a file is saved and an older version already exists, 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. Regional and Language Options Language:Adjust the language of the user interface. Changing this option doesn't affect the running program. You have to exit and restart &kdiff3; so that the language is changed. (This option is not available in the Frameworks version of &kdiff3;.) Use the same encoding for everything: The following encoding options can be adjusted separately for each item or if this option is true, all values will take the first value. Local Encoding:Above the codec-selectors appears a note that tells you what the local encoding is. (This is not adjustable but for your information just in case you don't know your local encoding, but need to select it.) File Encoding for A/B/C: Adjust the file encoding for input files. This has an effect on how the special characters are interpreted. Since you can adjust each codec separately you can even compare and merge files that were saved using different codecs. File Encoding for Merge Output and Saving: When you have edited a file, then you can adjust which encoding will be used when saving to disk. File Encoding for Preprocessor Files:When you define preprocessors then they might not be able to operate on your codec. (e.g.: Your files are 16-bit-unicode and your preprocessor can only take 8-bit-ascii.) With this option you can define the encoding of preprocessor output. Right To Left Language:Some languages are written right to left. When this option is enabled, &kdiff3; draws the text from right to left in the diff input windows and in the merge output window. Note that if you start &kdiff3; with the command line option "--reverse" then all layouting will be done right to left too. (This is a feature provided by Qt.) This documentation was written assuming that "Right To Left Language" or reverse layout are disabled. So some references to "left" or "right" must be replaced by their respective counterpart if you use these options. Miscellaneous (These options and actions are available in menus or the buttonbar.) Show line numbers: You can select if line numbers should be shown for the input files. Show space and tabulator characters for differences: Sometimes the visible spaces and tabs are disturbing. You can turn this off. Show white space: Turn this off to suppress any highlighting of white-space-only changes in the text or overview-columns. (Note that this also applies to changes in numbers or comments if the options "Ignore numbers" or "Ignore C/C++ comments" are active.) Overview options: These choices are only available when you compare three files. In normal mode all differences are shown in one color-coded overview-column. But sometimes you are especially interested in the differences between only two of these three files. Selecting "A vs. B", "A vs. C" or "B vs. C"-overview will show a second overview column with the required information next to the normal overview. Word wrap diff windows: Wrap lines when their length would exceed the width of a window. Show Window A/B/C: Sometimes you want to use the space on the screen better for long lines. Hide the windows that are not important. (In the Windows-menu.) Toggle Split Orientation: Switch between diff windows shown next to each other (A left of B left of C) or above each other (A above B above C). This should also help for long lines. (In the Windows-menu.) Start a merge quickly: Sometimes you are viewing the deltas and decide to merge. "Merge current file" in the Directory-menu also works if you only compare two files. A single click starts the merge and uses the filename of the last input-file as the default output filename. (When this is used to restart a merge, then the output filename will be preserved.) Configuring Keyboard-Shortcuts Currently only the Frameworks-version supports user-configurable keyboard-shortcuts. (Menu Settings->Configure Shortcuts...) Preprocessor Commands &kdiff3; supports two preprocessor options. Preprocessor-Command: When any file is read, it will be piped through this external command. The output of this command will be visible instead of the original file. You can write your own preprocessor that fulfills your specific needs. Use this to cut away disturbing parts of the file, or to automatically correct the indentation etc. Line-Matching Preprocessor-Command: When any file is read, it will be piped through this external command. If a preprocessor-command (see above) is also specified, then the output of the preprocessor is the input of the line-matching preprocessor. The output will only be used during the line matching phase of the analysis. You can write your own preprocessor that fulfills your specific needs. Each input line must have a corresponding output line. The idea is to allow the user greater flexibility while configuring the diff-result. But this requires an external program, and many users don't want to write one themselves. The good news is that very often sed or perl will do the job. Example: Simple testcase: Consider file a.txt (6 lines): aa ba ca da ea fa And file b.txt (3 lines): cg dg eg Without a preprocessor the following lines would be placed next to each other: aa - cg ba - dg ca - eg da ea fa This is probably not wanted since the first letter contains the actually interesting information. To help the matching algorithm to ignore the second letter we can use a line matching preprocessor command, that replaces 'g' with 'a': sed 's/g/a/' With this command the result of the comparison would be: aa ba ca - cg da - dg ea - eg fa Internally the matching algorithm sees the files after running the line matching preprocessor, but on the screen the file is unchanged. (The normal preprocessor would change the data also on the screen.) <command>sed</command> Basics This section only introduces some very basic features of sed. For more information see info:/sed or http://www.gnu.org/software/sed/manual/html_mono/sed.html. A precompiled version for Windows can be found at http://unxutils.sourceforge.net. Note that the following examples assume that the sed-command is in some directory in the PATH-environment variable. If this is not the case, you have to specify the full absolute path for the command. In this context only the sed-substitute-command is used: sed 's/REGEXP/REPLACEMENT/FLAGS' Before you use a new command within &kdiff3;, you should first test it in a console. Here the echo-command is useful. Example: echo abrakadabra | sed 's/a/o/' -> obrakadabra This example shows a very simple sed-command that replaces the first occurance of "a" with "o". If you want to replace all occurances then you need the "g"-flag: echo abrakadabra | sed 's/a/o/g' -> obrokodobro The "|"-symbol is the pipe-command that transfers the output of the previous command to the input of the following command. If you want to test with a longer file then you can use cat on Unix-like systems or type on Windows-like systems. sed will do the substitution for each line. cat filename | sed options Examples For <command>sed</command>-Use In &kdiff3; Ignoring Other Types Of Comments Currently &kdiff3; understands only C/C++ comments. Using the Line-Matching-Preprocessor-Command you can also ignore other types of comments, by converting them into C/C++-comments. Example: To ignore comments starting with "#", you would like to convert them to "//". Note that you also must enable the "Ignore C/C++-Comments" option to get an effect. An appropriate Line-Matching-Preprocessor-Command would be: sed 's/#/\/\//' Since for sed the "/"-character has a special meaning, it is necessary to place the "\"-character before each "/" in the replacement-string. Sometimes the "\" is required to add or remove a special meaning of certain characters. The single quotation marks (') are only important when testing on the command shell as it will otherwise attempt to process some characters. KDiff3 does not do this except for the escape sequences '\"' and '\\'. Caseinsensitive Diff Use the following Line-Matching-Preprocessor-Command to convert all input to uppercase: sed 's/\(.*\)/\U\1/' Here the ".*" is a regular expression that matches any string and in this context matches all characters in the line. The "\1" in the replacement string refers to the matched text within the first pair of "\(" and "\)". The "\U" converts the inserted text to uppercase. Ignoring Version Control Keywords CVS and other version control systems use several keywords to insert automatically generated strings (info:/cvs/Keyword substitution). All of them follow the pattern "$KEYWORD generated text$". We now need a Line-Matching-Preprocessor-Command that removes only the generated text: sed 's/\$\(Revision\|Author\|Log\|Header\|Date\).*\$/\$\1\$/' The "\|" separates the possible keywords. You might want to modify this list according to your needs. The "\" before the "$" is necessary because otherwise the "$" matches the end of the line. While experimenting with sed you might come to understand and even like these regular expressions. They are useful because there are many other programs that also support similar things. Ignoring Numbers Ignoring numbers actually is a built-in option. But as another example, this is how it would look as a Line-Matching-Preprocessor-command. sed 's/[0123456789.-]//g' Any character within '[' and ']' is a match and will be replaced with nothing. Ignoring Certain Columns Sometimes a text is very strictly formatted, and contains columns that you always want to ignore, while there are other columns you want to preserve for analysis. In the following example the first five columns (characters) are ignored, the next ten columns are preserved, then again five columns are ignored and the rest of the line is preserved. sed 's/.....\(..........\).....\(.*\)/\1\2/' Each dot '.' matches any single character. The "\1" and "\2" in the replacement string refer to the matched text within the first and second pair of "\(" and "\)" denoting the text to be preserved. Combining Several Substitutions Sometimes you want to apply several substitutions at once. You can then use the semicolon ';' to separate these from each other. Example: echo abrakadabra | sed 's/a/o/g;s/\(.*\)/\U\1/' -> OBROKODOBRO Using <command>perl</command> instead of <command>sed</command> Instead of sed you might want to use something else like perl. perl -p -e 's/REGEXP/REPLACEMENT/FLAGS' But some details are different in perl. Note that where sed needed "\(" and "\)" perl requires the simpler "(" and ")" without preceding '\'. Example: sed 's/\(.*\)/\U\1/' perl -p -e 's/(.*)/\U\1/' Order Of Preprocessor Execution The data is piped through all internal and external preprocessors in the following order: Normal preprocessor, Line-Matching-Preprocessor, Ignore case (conversion to uppercase), Detection of C/C++ comments, Ignore numbers, Ignore white space The data after the normal preprocessor will be preserved for display and merging. The other operations only modify the data that the line-matching-diff-algorithm sees. In the rare cases where you use a normal preprocessor note that the line-matching-preprocessor sees the output of the normal preprocessor as input. Warning The preprocessor-commands are often very useful, but as with any option that modifies your texts or hides away certain differences automatically, you might accidentally overlook certain differences and in the worst case destroy important data. For this reason during a merge if a normal preprocessor-command is being used &kdiff3; will tell you so and ask you if it should be disabled or not. But it won't warn you if a Line-Matching-Preprocessor-command is active. The merge will not complete until all conflicts are solved. If you disabled "Show White Space" then the differences that were removed with the Line-Matching-Preprocessor-command will also be invisible. If the Save-button remains disabled during a merge (because of remaining conflicts), make sure to enable "Show White Space". If you don't want to merge these less important differences manually you can select "Choose [A|B|C] For All Unsolved White space Conflicts" in the Merge-menu. Directory Comparison and Merge with &kdiff3; Introduction into Directory Comparison and Merge Often programmers must modify many files in a directory to achieve their purpose. For this &kdiff3; also lets you compare and merge complete directories recursively! Even though comparing and merging directories seems to be quite obvious, there are several details that you should know about. Most important is of course the fact that now many files might be affected by each operation. If you don't have backups of your original data, then it can be very hard or even impossible to return to the original state. So before starting a merge, make sure that your data is safe, and going back is possible. If you make an archive or use some version control system is your decision, but even experienced programmers and integrators need the old sources now and then. And note that even though I (the author of &kdiff3;) try to do my best, I can't guarantee that there are no bugs. According to the GNU-GPL there is NO WARRANTY whatsoever for this program. So be humble and always keep in mind:
To err is human, but to really mess things up you need a computer.
So this is what this program can do for you: &kdiff3; ... ... reads and compares two or three directories recursively, ... takes special care of symbolic links, ... lets you browse files on mouse double click, ... for each item proposes a merge operation, which you can change before starting the directory merge, ... lets you simulate the merge and lists the actions that would take place, without actually doing them, ... lets you really do the merge, and lets you interact whenever manual interaction is needed, ... lets you run the selected operation for all items (key F7) or the selected item (key F6), ... lets you continue the merge after manual interaction with key F7, ... optionally creates backups, with the ".orig" extension, ...
Starting Directory Comparison Or Merge This is very similar to the single file merge and comparison. You just have to specify directories on the command line or in the file-open dialog. Compare/Merge two directories: kdiff3 dir1 dir2 kdiff3 dir1 dir2 -o destdir If no destination directory is specified, then &kdiff3; will use dir2. Compare/Merge three directories: kdiff3 dir1 dir2 dir3 kdiff3 dir1 dir2 dir3 -o destdir When three directories are merged then dir1 is used as the base for the merge. If no destination directory is specified, then &kdiff3; will use dir3 as the destination directory for the merge. Note that only the comparison starts automatically, not the merge. For this you first must select a menu entry or the key F7. (More details later.) Directory Merge Visible Information While reading the directories a message-box appears that informs you of the progress. If you abort the directory scan, then only files that have been compared until then will be listed. When the directory scan is complete then &kdiff3; will show a listbox with the results left, ... ... and details about the currently selected item on the right: The Name Column Each file and directory that was found during the scan is shown here in a tree. You can select an item by clicking it with the mouse once. The directories are collapsed by default. You can expand and collapse them by clicking on the "+"/"-" or by double-clicking the item or by using the left/right-arrow-keys. The "Directory"-menu also contains two actions "Fold all subdirs" and "Unfold all subdirs" with which you can collapse or expand all directories at once. If you double-click a file item then the file comparison starts and the file-diff-window will appear. The image in the name column reflects the file type in the first directory ("A"). It can be one of these: Normal file Normal directory (directory-image) Link to a file (file-image with a link arrow) Link to a directory (directory-image with a link arrow) If the file type is different in the other directories, then this is visible in the columns A/B/C and in the window that shows the details about the selected item. Note that for such a case no merge operation can be selected automatically. When starting the merge, then the user will be informed of problems of that kind. The Columns A/B/C and the Coloring Scheme As can be seen in the image above the colors red, green, yellow and black are used in the columns A/B/C. Black: This item doesn't exist in this directory. Green: Newest item. Yellow: Older than green, newer than red. Red: Oldest item. But for items that were identical in the comparison their color also is identical even if the age is not. Directories are considered equal if all items they contain are identical. Then they also will have the same color. But the age of a directory is not considered for its color. The idea for this coloring scheme I came upon in dirdiff. The colors resemble the colors of a leaf that is green when new, turns yellow later and red when old. The Operation Column After comparing the directories &kdiff3; also evaluates a proposal for a merge operation. This is shown in the "Operation" column. You can modify the operation by clicking on the operation you want to change. A small menu will popup and allows you to select an operation for that item. (You can also select the most needed operations via keyboard. Ctrl+1/2/3/4/Del will select A/B/C/Merge/Delete respectively if available.) This operation will be executed during the merge. It depends on the item and on the merge-mode you are in, what operations are available. The merge-mode is one of Three directory-merge ("A" is treated as older base of both). Two directory-merge. Two directory-sync-mode (activate via option "Synchronize Directories"). In three directory merge the operation proposal will be: If for an item ... ... all three directories are equal: Copy from C ... A and C are equal but B is not: Copy from B (or if B does not exist, delete the destination if exists) ... A and B are equal but C is not: Copy from C (or if C does not exist, delete the destination if exists) ... B and C are equal but A is not: Copy from C (or if C does not exist, delete the destination if exists) ... only A exists: Delete the destination (if exists) ... only B exists: Copy from B ... only C exists: Copy from C ... A, B and C are not equal: Merge ... A, B and C don't have the same file type (e.g. A is a directory, B is a file): "Error: Conflicting File Types". While such items exist the directory merge cannot start. In two directory merge the operation proposal will be: If for an item ... ... both directories are equal: Copy from B ... A exists, but not B: Copy from A ... B exists, but not A: Copy from B ... A and B exist but are not equal: Merge ... A and B don't have the same file type (e.g. A is a directory, B is a file): "Error: Conflicting File Types". While such items exist the directory merge cannot start. Sync-mode is active if only two directories and no explicit destination were specified and if the option "Synchronize directories" is active. &kdiff3; then selects a default operation so that both directories are the same afterwards. If for an item ... ... both directories are equal: Nothing will be done. ... A exists, but not B: Copy A to B ... B exists, but not A: Copy B to A ... A and B exist, but are not equal: Merge and store the result in both directories. (For the user the visible save-filename is B, but then &kdiff3; copies B also to A.) ... A and B don't have the same file type (e.g. A is a directory, B is a file): "Error: Conflicting File Types". While such items exist the directory merge cannot start. When two directories are merged and the option "Copy newer instead of merging" is selected, then &kdiff3; looks at the dates and proposes to choose the newer file. If the files are not equal but have equal dates, then the operation will contain "Error: Dates are equal but files are not." While such items exist the directory merge cannot start. The Status Column During the merge one file after the other will be processed. The status column will show "Done" for items where the merge operation has succeeded, and other texts if something unexpected happened. When a merge is complete, then you should make a last check to see if the status for all items is agreeable. Statistics Columns When the file comparison mode "Full Analysis" is enabled in the options, then &kdiff3; will show extra columns containing the numbers of unsolved, solved, nonwhite and whitespace conflicts. (The solved-column will only show when comparing or merging three directories.) Selecting Listed Files Several options influence which files are listed here. Some are accessible in the settings dialog. The Directory-menu contains the entries: "Show Identical Files": Files that have been detected equal in all input directories. "Show Different Files": Files that exist in two or more directories but are not equal. "Show Files only in A": Files that exist only in A, but not in B or C. "Show Files only in B": Files that exist only in B, but not in A or C. "Show Files only in C": Files that exist only in C, but not in A or B. Activate only the "Show"-options for the items you want listed. If for example you only want to list all items that exist either in A or in B but not in both, you'll have to activate "Show Files only in A" and "Show Files only in B" and deactivate all others ("Show Identical Files", "Show Different Files", "Show Files only in C"). The list will be updated immediately to reflect the change. These options also apply for directories with one exception: Disabling "Show Different Files" will not hide any complete directories. This will work only for files within. Note that of these only the "Show Identical Files"-option is persistant. The others are enabled when starting &kdiff3;. Doing A Directory Merge You can either merge the currently selected item (file or directory), or all items. When you have made all your operation choices (in all subdirectories too) then you can start the merge. Be aware that if you didn't specify a destination directory explicitly, then the destination will be "C" in three directory mode, "B" in two directory merge mode, and in sync-mode it will be "A" or/and "B". If you have specified a destination directory also check that all items that should be in the output, are in the tree. There are some options that cause certain items to be omitted from the directory comparison and merge. Check these options to avoid unpleasant surprises: "Recursive Directories": If this is off, then items in subdirectories will not be found. "Pattern"/"Anti-Pattern": Include/exclude items that match "Exclude Hidden Files" "Show"-options (Show Identical/Different Files, Files only in A/B/C) If you change the settings in order to list more files, you must do a rescan via menu "Directory"->"Rescan" yourself. (The reason for this is that for faster comparison-speed &kdiff3; omits the comparison for files suppressed by these criteria.) If you changed your file and dir patterns to exclude files, then the file-list will immediately be updated on closing the options-dialog. Note that when you write to a completely new directory then you usually also want to copy the identical files. In that case enable the "Show Identical Files"-option. If your destination-directory is one of the inputs, then this isn't necessary because the file is already there. If you are satisfied so far, the rest is easy. To merge all items: Select "Start/Continue directory merge" in the "Directory"-menu or press F7 (which is the default shortcut). To merge only the current item: Select "Run Operation For Current Item" or press F6. If due to conflicting filetypes still some items with invalid operations exist, then a messagebox will appear and these items will be pointed out, so you can select a valid operation for the item. If you merge all items a dialog will appear giving you the options "Do it", "Simulate it" and "Cancel". Select "Simulate it" if you want to see what would be done without actually doing it. A verbose list of all operations will be shown. Otherwise select "Do it" to really start merging. Then &kdiff3; will run the specified operation for all items. If manual interaction is required (single file merge), then a merge window will open (see the big screenshot). When you have finished with manually merging a file, again select "Start/Continue directory merge" or the key F7. If you haven't saved it yet, a dialog will ask you to do so. Then &kdiff3; will continue with the next item. When &kdiff3; encounters an error, it will tell you so and will show the verbose-status-information. At the bottom of this list, there will be some error messages which should help you to understand the cause of the problem. When you continue merging (F7 key) &kdiff3; will give you the choice to retry or skip the item that caused the problem. This means that before continuing you can choose another operation or solve the problem by other means. When the merge is complete, then &kdiff3; will inform you via a message box. If some items were merged individually before running the directorymerge then &kdiff3; remembers this (while this merge-session goes on), and doesn't merge them again when later the merge for all items is run. Even when the merge was skipped or nothing was saved these items count as completed. Only when you change the merge operation the "Done"-status of the item will be removed and it can be merged again. Options for Comparing and Merging Directories The &kdiff3;-preferences (menu "Settings"->"Configure &kdiff3;") 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 by using the semicolon ";" as separator. Valid wildcards: '*' and '?'. (e.g. "*.cpp;*.h"). Default is "*". This pattern is not used on directories. File Anti-Pattern(s): Files 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;*.obj". Directory Anti-Pattern(s): 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 "CVS;deps;.svn". 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 file systems 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. Case Sensitive Filename Comparison: Default is false on Windows, true for other operating systems. 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 you know, 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. Other Functions in Directory Merge Window Split/Full Screen Mode Usually the directory merge list view remains visible while a single file is compared or merged. With the mouse you can move the splitter bar that separates the file list from the text-diff windows. If you don't want this, you can disable "Split Screen View" in the "Directory"-menu. Then you can use "Toggle View" in the "Directory"-menu to switch between the file list and the text-diff view that then occupy the full screen. Comparing or Merging a Single File Probably you will prefer a simple double mouse click on a file in order to compare it. Nevertheless there also exists an entry in the "Directory"-menu. You can also directly merge a single file by selecting it and choosing "Merge current file" in the "Merge"-Menu. On saving the result, the status will be set to done, and the file will not be merged again if a directory merge is started. But note that this status information will be lost when you rerun a directory scan: "Directory"-menu: "Rescan" Comparing or Merging Files with Different Names Sometimes you need to compare or merge files with different names (e.g. the current file and the backup in the same folder). Select the exact file by clicking onto the icon in the column A, B or C. The first file selected thus will be marked with an "A", the second and third with "B" and "C" regardless on what column they are in. Only up to three files can be chosen like this. Proceed by choosing "Compare Explicitly Selected Files" or "Merge Explicitly Selected Files" from the "Directory"-menu. For your convenience these menu entries also appear as context menu when you right-click the last selected file. The comparison or merge of a file will happen in the same window. If this method is used for directories a new window will be opened.
Miscellaneous Topics Networktransparency via KIO KIO-Slaves The KIO library from Frameworks supports networktransparency via KIO-slaves. &kdiff3; uses this for reading input files and for scanning directories. This means that you can specify files and directories on local and remote resources via URLs. Example: kdiff3 test.cpp ftp://ftp.faraway.org/test.cpp kdiff3 tar:/home/hacker/archive.tar.gz/dir ./dir The first line compares a local file with a file on an FTP-server. The second line compares a directory within an compressed archive with a local directory. Other KIO-slaves that are interesting are: Files from the WWW (http:), Files from the FTP (ftp:), Encrypted file transfer (fish:, sftp:), Windows-resources (smb:), Local files (file:), Other things that are possible, but probably less useful are: Man-pages (man:), Info-pages (info:), How To Write URLs An URL has a different syntax compared with paths for local files and directories. Some things should be considered: A path can be relative and can contain "." or "..". This is not possible for URLs which are always absolute. Special characters must be written with "escaping". ("#"->"%23", space->"%20", etc.) E.g. A file with the name "/#foo#" would have the URL "file:/%23foo%23". When URLs don't work as expected, try to open them in Konqueror first. Capabilities of KIO-Slaves Networktransparency has one drawback: Not all resources have the same capabilities. Sometimes this is due to the file system of the server, sometimes due to the protocol. Here is a short list of restrictions: Sometimes there is no support for links. Or there is no way to distinguish if a link points to a file or a directory; always assuming a file. (ftp:, sftp:). Can't always determine the filesize. Limited support for permissions. No possibility to modify permissions or modification time, so permissions or time of a copy will differ from the original. (See the option "Trust the size".) (To modify permissions or modification time is only possible for local files.) Using &kdiff3; as a KPart &kdiff3; is a KPart. Currently it implements the KParts::ReadOnlyPart-interface. It's main use is as difference-viewer in KDevelop. KDevelop always starts the internal difference viewer first. To invoke &kdiff3; press the right mouse button on the difference viewer window and select "Show in KDiff3Part" from the context menu. &kdiff3; normally requires two complete files as input. When used as part &kdiff3; will assume that the input file is a patch-file in the unified format. &kdiff3; then retrieves the original filenames from the patch-file. At least one of the two files must be available. &kdiff3; will then invoke patch to recreate the second file. In &dolphin; you can select a patch-file and select "Preview in"-"KDiff3Part" from the context menu. Be aware that this won't work if none of the original files are available, and it is not reliable if the original file(s) have changed since the patch-file was generated. When run as a part &kdiff3; only provides the a two-file-diff, a very small toolbar and menu. Merging or directory-comparison are not supported then. Questions and Answers &reporting.bugs; &updating.documentation; Why is it called "&kdiff3;"? Tools named "KDiff" and "KDiff2" (now called "Kompare") already exist. Also "KDiff3" should suggest that it can merge like the "diff3"-tool in the Diff-Tool collection. Why did I release it under GPL? I'm using GPL programs for a very long time now and learned very much by having a look at many of the sources. Hence this is my "Thank You" to all programmers that also did so or will do the same. Some buttons and functions are missing. What's wrong? You compiled from source but you probably didn't specify the correct prefix for the installation. By default cmake wants to install in /usr/local but then the user-interface resource file (i.e. kdiff3ui.rc) can't be found. The README-file contains more information about the correct prefix. Often lines that are similar but not identical appear next to each other but sometimes not. Why? Lines where only the amount of white space characters is different are treated as "equal" at first, while just one different non-white character causes the lines to be "different". If similar lines appear next to each other, this actually is coincidence but this fortunately is often the case. See also Manual Diff Help. Why must all conflicts be solved before the merge result can be saved? For each equal or different section the editor in the merge result window remembers where it begins or ends. This is needed so that conflicts can be solved manually by simply selecting the source button (A, B or C). This information is lost while saving as text and it is too much effort to create a special file format that supports saving and restoring all necessary information. How can I synchronise the diff and merge views, so that all views show the same text position? Click into the summary column left of the text. (See also here.) Why does the editor in the merge result window not have an "undo"-function? This was too much effort until now. You can always restore a version from one source (A, B or C) by clicking the respective button. For big editing the use of another editor is recommended anyway. When I removed some text, then suddenly "<No src line>" appeared and cannot be deleted. What does that mean and how can one remove this? For each equal or different section the editor in the merge result window remembers where it begins or ends. "<No src line>" means that there is nothing left in a section, not even a new line character. This can happen either while merging automatically or by editing. This is no problem, since this hint won't appear in the saved file. If you want the orignal source back just select the section (click on the left summary column) and then click the source button with the needed contents (A/B or C). Why doesn't &kdiff3; support syntax-highlighting? &kdiff3; already uses many colors for difference highlighting. More highlighting would be confusing. Use another editor for this. Can I use &kdiff3; to compare OpenOffice.Org, Word, Excel, PDF-, &etc; files? Although &kdiff3; will analyse any kind of file the result will probably not be very satisfactory for you. &kdiff3; was made to compare pure text files. OpenOffice, Word, Excel etc. store much more information in the files (about fonts, pictures, pages, colors etc.) which &kdiff3; doesn't know about. So &kdiff3; will show you the contents of the file interpreted as pure text, but this might be unreadable or at least it will look very odd. Since most programs nowadays store their contents in XML-format, you might be able to read it as pure text. So if the change was only small, &kdiff3; still might help you. The best solution if you only want to compare the text (without embedded objects like pictures) is to use "Select All" and "Copy" in your program to copy the interesting text to the clipboard and then in &kdiff3; paste the text into either diff input window. (See also Select, Copy And Paste.) Where has the directory option "List only deltas" gone? There are now several "Show"-options in the directory menu. Disabling "Show identical files" will achieve what enabling "List only deltas" used to do. How can I make a big selection in the diff input window because scrolling takes so long? Start the selection as usual (click and hold the left mouse button). Then use the navigation keys (e.g. page up, page down) while holding the left mouse button down. (See also Select, Copy And Paste.) There is so much information here, but your question is still not answered? Please send me your question. I appreciate every comment. Credits and License &kdiff3; - File and Directory Comparison and Merge Tool Program copyright 2002-2007 Joachim Eibl joachim.eibl at gmx.de Several cool ideas and bugreports came from colleagues and many people out in the Wild Wild Web. Thank you! Documentation Copyright © 2002-2007 Joachim Eibl joachim.eibl at gmx.de &underFDL; &underGPL; &documentation.index;
diff --git a/doc/en/man-kdiff3.1.docbook b/doc/en/man-kdiff3.1.docbook index b1c086f..2243f92 100644 --- a/doc/en/man-kdiff3.1.docbook +++ b/doc/en/man-kdiff3.1.docbook @@ -1,206 +1,206 @@ ]> KDiff3 User's Manual BurkhardLueck KDiff3 man page. &Burkhard.Lueck.mail; 2018-05-19 -kdiff3 1.7.0 +kdiff3 1.7.90 kdiff3 1 kdiff3 Tool for Comparison and Merge of Files and Directories kdiff3 file file file alias1 alias2 alias3 alias string file Description Compares two or three input files or directories. Options Ignored. (User defined.) Ignored. (User defined.) Ignored. (User defined.) Ignored. (User defined.) Merge the input. file Explicit base file. For compatibility with certain tools. file Output file. Implies -m. ⪚: -o newfile.txt file Output file, again. (For compatibility with certain tools.) No GUI if all conflicts are auto-solvable. (Needs file) Don't solve conflicts automatically. alias1 Visible name replacement for input file 1 (base). alias2 Visible name replacement for input file 2. alias3 Visible name replacement for input file 3. alias Alternative visible name replacement. Supply this once for every input. string Override a config setting. Use once for every setting. ⪚: AutoAdvance=1. Show list of config settings and current values. file Use a different config file. file1 to open (base, if not specified via --) file2 to open file2 to open See Also More detailed user documentation is available from help:/kdiff3 (either enter this &URL; into &konqueror;, or run khelpcenter help:/kdiff3). kf5options(7) qt5options(7) Authors This manual page was written by &Burkhard.Lueck; &Burkhard.Lueck.mail;. diff --git a/src/main.cpp b/src/main.cpp index f38f9a8..6db41be 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,212 +1,210 @@ /*************************************************************************** main.cpp - Where everything starts. ------------------- begin : Don Jul 11 12:31:29 CEST 2002 copyright : (C) 2002-2007 by Joachim Eibl email : joachim.eibl at gmx.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "common.h" #include "kdiff3_shell.h" #include "version.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #include #ifdef Q_OS_WIN #include #include #endif void initialiseCmdLineArgs(QCommandLineParser* cmdLineParser) { QString configFileName = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, "kdiff3rc"); QFile configFile(configFileName); QString ignorableOptionsLine = "-u;-query;-html;-abort"; if(configFile.open(QIODevice::ReadOnly)) { QTextStream ts(&configFile); while(!ts.atEnd()) { QString line = ts.readLine(); if(line.startsWith(QLatin1String("IgnorableCmdLineOptions="))) { int pos = line.indexOf('='); if(pos >= 0) { ignorableOptionsLine = line.mid(pos + 1); } break; } } } //support our own old preferances this is obsolete QStringList sl = ignorableOptionsLine.split(','); if(!sl.isEmpty()) { QStringList ignorableOptions = sl.front().split(';'); for(QStringList::iterator i = ignorableOptions.begin(); i != ignorableOptions.end(); ++i) { (*i).remove('-'); if(!(*i).isEmpty()) { if(i->length() == 1) { cmdLineParser->addOption(QCommandLineOption(QStringList() << i->toLatin1() << QLatin1String("ignore"), i18n("Ignored. (User defined.)"))); } else { cmdLineParser->addOption(QCommandLineOption(QStringList() << i->toLatin1(), i18n("Ignored. (User defined.)"))); } } } } } #ifdef Q_OS_WIN // This command checks the comm static bool isOptionUsed(const QString& s, int argc, char* argv[]) { for(int j = 0; j < argc; ++j) { if(QString("-" + s) == argv[j] || QString("--" + s) == argv[j]) { return true; } } return false; } #endif int main(int argc, char* argv[]) { QApplication app(argc, argv); // KAboutData and QCommandLineParser depend on this being setup. KLocalizedString::setApplicationDomain("kdiff3"); KCrash::initialize(); const QByteArray& appName = QByteArray::fromRawData("kdiff3", 6); const QString i18nName = i18n("KDiff3"); - QByteArray appVersion = QByteArray::fromRawData(VERSION, sizeof(VERSION)); + QByteArray appVersion = QByteArray::fromRawData(KDIFF3_VERSION, sizeof(KDIFF3_VERSION)); if(sizeof(void*) == 8) appVersion += " (64 bit)"; else if(sizeof(void*) == 4) appVersion += " (32 bit)"; const QString description = i18n("Tool for Comparison and Merge of Files and Directories"); const QString copyright = i18n("(c) 2002-2014 Joachim Eibl, (c) 2017 Michael Reeves KF5/Qt5 port"); const QString& homePage = QStringLiteral(""); const QString& bugsAddress = QStringLiteral("reeves.87""@""gmail.com"); KAboutData aboutData(appName, i18nName, appVersion, description, KAboutLicense::GPL_V2, copyright, description, homePage, bugsAddress); KAboutData::setApplicationData(aboutData); QCommandLineParser* cmdLineParser = KDiff3Shell::getParser(); cmdLineParser->setApplicationDescription(aboutData.shortDescription()); cmdLineParser->addVersionOption(); cmdLineParser->addHelpOption(); aboutData.setupCommandLine(cmdLineParser); initialiseCmdLineArgs(cmdLineParser); // ignorable command options cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("m") << QLatin1String("merge"), i18n("Merge the input."))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("b") << QLatin1String("base"), i18n("Explicit base file. For compatibility with certain tools."), QLatin1String("file"))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("o") << QLatin1String("output"), i18n("Output file. Implies -m. E.g.: -o newfile.txt"), QLatin1String("file"))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("out"), i18n("Output file, again. (For compatibility with certain tools.)"), QLatin1String("file"))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("auto"), i18n("No GUI if all conflicts are auto-solvable. (Needs -o file)"))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("qall"), i18n("Do not solve conflicts automatically."))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("L1"), i18n("Visible name replacement for input file 1 (base)."), QLatin1String("alias1"))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("L2"), i18n("Visible name replacement for input file 2."), QLatin1String("alias2"))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("L3"), i18n("Visible name replacement for input file 3."), QLatin1String("alias3"))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("L") << QLatin1String("fname alias"), i18n("Alternative visible name replacement. Supply this once for every input."))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("cs"), i18n("Override a config setting. Use once for every setting. E.g.: --cs \"AutoAdvance=1\""), QLatin1String("string"))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("confighelp"), i18n("Show list of config settings and current values."))); cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("config"), i18n("Use a different config file."), QLatin1String("file"))); // other command options cmdLineParser->addPositionalArgument(QLatin1String("[File1]"), i18n("file1 to open (base, if not specified via --base)")); cmdLineParser->addPositionalArgument(QLatin1String("[File2]"), i18n("file2 to open")); cmdLineParser->addPositionalArgument(QLatin1String("[File3]"), i18n("file3 to open")); /* Don't use QCommandLineParser::process as it auto terminates the program if an option is not reconized. Further more errors are directed to the console alone if not running on windows. This makes for a bad user experiance when run from a graphical interface such as kde. Don't assume that this only happens when running from a commandline. */ if(!cmdLineParser->parse(QCoreApplication::arguments())) { QString errorMessage = cmdLineParser->errorText(); QString helpText = cmdLineParser->helpText(); QMessageBox::warning(nullptr, aboutData.displayName(), "

" + errorMessage + "

" + i18n("See kdiff3 --help for supported options.") + "
"); #if !defined(Q_OS_WIN) fputs(qPrintable(errorMessage), stderr); fputs("\n\n", stderr); fputs(qPrintable(helpText + "\n"), stderr); fputs("\n", stderr); #endif exit(1); } if(cmdLineParser->isSet(QStringLiteral("version"))) { QMessageBox::information(nullptr, aboutData.displayName(), aboutData.displayName() + ' ' + aboutData.version()); #if !defined(Q_OS_WIN) printf("%s %s\n", appName.constData(), appVersion.constData()); #endif exit(0); } if(cmdLineParser->isSet(QStringLiteral("help"))) { QMessageBox::warning(nullptr, aboutData.displayName(), "
" + cmdLineParser->helpText() + "
"); #if !defined(Q_OS_WIN) fputs(qPrintable(cmdLineParser->helpText()), stdout); #endif exit(0); } aboutData.processCommandLine(cmdLineParser); /** * take component name and org. name from KAboutData */ app.setApplicationName(aboutData.componentName()); app.setApplicationDisplayName(aboutData.displayName()); app.setOrganizationDomain(aboutData.organizationDomain()); app.setApplicationVersion(aboutData.version()); KDiff3Shell* p = new KDiff3Shell(); p->show(); //p->setWindowState( p->windowState() | Qt::WindowActive ); // Patch for ubuntu: window not active on startup //app.installEventFilter( new CFilter ); int retVal = app.exec(); /* if (QApplication::clipboard()->text().size() == 0) QApplication::clipboard()->clear(); // Patch for Ubuntu: Fix issue with Qt clipboard*/ return retVal; } -// Suppress warning with --enable-final -#undef VERSION diff --git a/src/version.h b/src/version.h index 5216d49..e7c1a41 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1,2 @@ -#undef VERSION -#define VERSION "1.7.0" +#undef KDIFF3_VERSION +#define KDIFF3_VERSION "1.7.90" diff --git a/windows_installer/kdiff3.nsi b/windows_installer/kdiff3.nsi index 4e4f95d..ab47963 100755 --- a/windows_installer/kdiff3.nsi +++ b/windows_installer/kdiff3.nsi @@ -1,515 +1,515 @@ ;KDiff3-NSIS configuration ;Based on Modern User Interface example files ;Apdapted for KDiff3 by Sebastien Fricker and Joachim Eibl ;Requires nsis_v2.19 -!define KDIFF3_VERSION "0.9.98" +!define KDIFF3_VERSION "1.70.90" !define DIFF_EXT32_CLSID "{9F8528E4-AB20-456E-84E5-3CE69D8720F3}" !define DIFF_EXT64_CLSID "{34471FFB-4002-438b-8952-E4588D0C0FE9}" !ifdef KDIFF3_64BIT !define BITS 64 !else !define BITS 32 !endif !define SetupFileName "KDiff3-${BITS}bit-Setup_${KDIFF3_VERSION}.exe" ;-------------------------------- ;Include Modern UI !include "MUI.nsh" !include "x64.nsh" ;-------------------------------- ;General ;Name and file Name "KDiff3" OutFile ${SetupFileName} ;Default installation folder !ifdef KDIFF3_64BIT ;SetRegView 64 InstallDir "$PROGRAMFILES64\KDiff3" !else InstallDir "$PROGRAMFILES\KDiff3" !endif ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\KDiff3" "" !addplugindir ".\nsisplugins" ;-------------------------------- ;Variables Var MUI_TEMP Var STARTMENU_FOLDER Var DIFF_EXT_CLSID Var DIFF_EXT_ID Var DIFF_EXT_DLL Var DIFF_EXT_OLD_DLL ;-------------------------------- ;Interface Settings !define MUI_ABORTWARNING !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP "kdiff3.bmp" ; optional ;-------------------------------- ;Language Selection Dialog Settings ;Remember the installer language !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" !define MUI_LANGDLL_REGISTRY_KEY "Software\KDiff3" !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" ;-------------------------------- ;Pages ;!insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE $(MUILicense) !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY Page custom CustomPageC ;Start Menu Folder Page Configuration !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\KDiff3" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER !insertmacro MUI_PAGE_INSTFILES !define MUI_FINISHPAGE_RUN KDiff3.exe !define MUI_FINISHPAGE_RUN_NOTCHECKED !define MUI_FINISHPAGE_SHOWREADME README_WIN.txt !define MUI_FINISHPAGE_SHOWREADME_CHECKED !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" # first language is the default language !insertmacro MUI_LANGUAGE "French" !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "Spanish" !insertmacro MUI_LANGUAGE "SimpChinese" !insertmacro MUI_LANGUAGE "TradChinese" !insertmacro MUI_LANGUAGE "Japanese" !insertmacro MUI_LANGUAGE "Korean" !insertmacro MUI_LANGUAGE "Italian" !insertmacro MUI_LANGUAGE "Dutch" !insertmacro MUI_LANGUAGE "Danish" !insertmacro MUI_LANGUAGE "Swedish" !insertmacro MUI_LANGUAGE "Norwegian" !insertmacro MUI_LANGUAGE "Finnish" !insertmacro MUI_LANGUAGE "Greek" !insertmacro MUI_LANGUAGE "Russian" !insertmacro MUI_LANGUAGE "Portuguese" !insertmacro MUI_LANGUAGE "PortugueseBR" !insertmacro MUI_LANGUAGE "Polish" !insertmacro MUI_LANGUAGE "Ukrainian" !insertmacro MUI_LANGUAGE "Czech" !insertmacro MUI_LANGUAGE "Slovak" !insertmacro MUI_LANGUAGE "Croatian" !insertmacro MUI_LANGUAGE "Bulgarian" !insertmacro MUI_LANGUAGE "Hungarian" !insertmacro MUI_LANGUAGE "Thai" !insertmacro MUI_LANGUAGE "Romanian" !insertmacro MUI_LANGUAGE "Latvian" !insertmacro MUI_LANGUAGE "Macedonian" !insertmacro MUI_LANGUAGE "Estonian" !insertmacro MUI_LANGUAGE "Turkish" !insertmacro MUI_LANGUAGE "Lithuanian" !insertmacro MUI_LANGUAGE "Catalan" !insertmacro MUI_LANGUAGE "Slovenian" !insertmacro MUI_LANGUAGE "Serbian" !insertmacro MUI_LANGUAGE "SerbianLatin" !insertmacro MUI_LANGUAGE "Arabic" !insertmacro MUI_LANGUAGE "Farsi" !insertmacro MUI_LANGUAGE "Hebrew" !insertmacro MUI_LANGUAGE "Indonesian" !insertmacro MUI_LANGUAGE "Mongolian" !insertmacro MUI_LANGUAGE "Luxembourgish" !insertmacro MUI_LANGUAGE "Albanian" !insertmacro MUI_LANGUAGE "Breton" !insertmacro MUI_LANGUAGE "Belarusian" !insertmacro MUI_LANGUAGE "Icelandic" !insertmacro MUI_LANGUAGE "Malay" !insertmacro MUI_LANGUAGE "Bosnian" !insertmacro MUI_LANGUAGE "Kurdish" ;-------------------------------- ;License Language String LicenseLangString MUILicense ${LANG_ENGLISH} "COPYING.txt" LicenseLangString MUILicense ${LANG_FRENCH} "COPYING.txt" LicenseLangString MUILicense ${LANG_GERMAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_SPANISH} "COPYING.txt" LicenseLangString MUILicense ${LANG_SIMPCHINESE} "COPYING.txt" LicenseLangString MUILicense ${LANG_TRADCHINESE} "COPYING.txt" LicenseLangString MUILicense ${LANG_JAPANESE} "COPYING.txt" LicenseLangString MUILicense ${LANG_KOREAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_ITALIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_DUTCH} "COPYING.txt" LicenseLangString MUILicense ${LANG_DANISH} "COPYING.txt" LicenseLangString MUILicense ${LANG_SWEDISH} "COPYING.txt" LicenseLangString MUILicense ${LANG_NORWEGIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_FINNISH} "COPYING.txt" LicenseLangString MUILicense ${LANG_GREEK} "COPYING.txt" LicenseLangString MUILicense ${LANG_RUSSIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_PORTUGUESE} "COPYING.txt" LicenseLangString MUILicense ${LANG_PORTUGUESEBR} "COPYING.txt" LicenseLangString MUILicense ${LANG_POLISH} "COPYING.txt" LicenseLangString MUILicense ${LANG_UKRAINIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_CZECH} "COPYING.txt" LicenseLangString MUILicense ${LANG_SLOVAK} "COPYING.txt" LicenseLangString MUILicense ${LANG_CROATIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_BULGARIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_HUNGARIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_THAI} "COPYING.txt" LicenseLangString MUILicense ${LANG_ROMANIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_LATVIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_MACEDONIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_ESTONIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_TURKISH} "COPYING.txt" LicenseLangString MUILicense ${LANG_LITHUANIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_CATALAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_SLOVENIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_SERBIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_SERBIANLATIN} "COPYING.txt" LicenseLangString MUILicense ${LANG_ARABIC} "COPYING.txt" LicenseLangString MUILicense ${LANG_FARSI} "COPYING.txt" LicenseLangString MUILicense ${LANG_HEBREW} "COPYING.txt" LicenseLangString MUILicense ${LANG_INDONESIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_MONGOLIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_LUXEMBOURGISH} "COPYING.txt" LicenseLangString MUILicense ${LANG_ALBANIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_BRETON} "COPYING.txt" LicenseLangString MUILicense ${LANG_BELARUSIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_ICELANDIC} "COPYING.txt" LicenseLangString MUILicense ${LANG_MALAY} "COPYING.txt" LicenseLangString MUILicense ${LANG_BOSNIAN} "COPYING.txt" LicenseLangString MUILicense ${LANG_KURDISH} "COPYING.txt" ;-------------------------------- ;Reserve Files ;These files should be inserted before other files in the data block ;Keep these lines before any File command ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA) !insertmacro MUI_RESERVEFILE_LANGDLL ReserveFile "installForAllUsersPage.ini" !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;-------------------------------- ;Variables Var INSTALL_FOR_ALL_USERS ;-------------------------------- ;Installer Sections Section "Software" SecSoftware SectionIn RO ;Read a value from an InstallOptions INI file !insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_FOR_ALL_USERS "installForAllUsersPage.ini" "Field 2" "State" ;Set ShellVarContext: Defines if SHCTX points to HKLM or HKCU StrCmp $INSTALL_FOR_ALL_USERS "0" "" +3 SetShellVarContext current Goto +2 SetShellVarContext all WriteRegStr HKCU "Software\KDiff3" "InstalledForAllUsers" "$INSTALL_FOR_ALL_USERS" ; Make the KDiff3 uninstaller visible via "System Settings: Add or Remove Programs", (Systemsteuerung/Software) WriteRegStr SHCTX "Software\KDiff3" "" "$INSTDIR" WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\KDiff3" "DisplayName" "KDiff3 (remove only)" WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\KDiff3" "UninstallString" '"$INSTDIR\Uninstall.exe"' SetOutPath "$INSTDIR" ;ADD YOUR OWN FILES HERE... DetailPrint "Writing files" File "${BITS}bit\kdiff3.exe" File "${BITS}bit\kdiff3.exe.manifest" File "${BITS}bit\qt.conf" File "COPYING.txt" File "Readme_Win.txt" File "ChangeLog.txt" SetOutPath "$INSTDIR\bin" File /r "${BITS}bit\bin\*.*" SetOutPath "$INSTDIR" Delete "$INSTDIR\kdiff3-QT4.exe" ;Store installation folder WriteRegStr HKCU "Software\KDiff3" "" $INSTDIR ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application ;Create shortcuts CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\KDiff3.lnk" "$INSTDIR\kdiff3.exe" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Readme.lnk" "$INSTDIR\Readme_Win.txt" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GPL.lnk" "$INSTDIR\Copying.txt" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$QUICKLAUNCH\KDiff3.lnk" "$INSTDIR\kdiff3.exe" !insertmacro MUI_STARTMENU_WRITE_END SectionEnd Section "Documentation" SecDocumentation DetailPrint "Writing the documentation" SetOutPath "$INSTDIR" File /r doc CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Documentation.lnk" "$INSTDIR\doc\index.html" SectionEnd Section "Translations" SecTranslations DetailPrint "Writing the translation messages" SetOutPath "$INSTDIR" File /r translations SectionEnd Section "Utilities" SecUtilities DetailPrint "Writing the command line utilities (GNU sed, diff, diff3, etc.)" SetOutPath "$INSTDIR\bin" File /r "bin\*.*" SectionEnd SubSection "Integration" SecIntegration Section "Explorer" SecIntegrationExplorer DetailPrint "Integration to Explorer" ; WriteRegStr HKCR "Directory\shell\KDiff3" "" '&KDiff3' ; WriteRegStr HKCR "Directory\shell\KDiff3\command" "" '"$INSTDIR\kdiff3.exe" "%1"' CreateShortCut "$SENDTO\KDiff3.lnk" '"$INSTDIR\kdiff3.exe"' SectionEnd Section "Diff-Ext" SecIntegrationDiffExtForKDiff3 DetailPrint "Diff-Ext for KDiff3" SetOutPath "$INSTDIR" ${If} ${RunningX64} StrCpy $DIFF_EXT_CLSID ${DIFF_EXT64_CLSID} StrCpy $DIFF_EXT_DLL "diff_ext_for_kdiff3_64.dll" StrCpy $DIFF_EXT_OLD_DLL "diff_ext_for_kdiff3_64_old.dll" StrCpy $DIFF_EXT_ID "diff-ext-for-kdiff3-64" IfFileExists "$INSTDIR\$DIFF_EXT_OLD_DLL" 0 +2 Delete "$INSTDIR\$DIFF_EXT_OLD_DLL" IfFileExists "$INSTDIR\$DIFF_EXT_DLL" 0 +2 Rename "$INSTDIR\$DIFF_EXT_DLL" "$INSTDIR\$DIFF_EXT_OLD_DLL" File "64bit\diff_ext_for_kdiff3_64.dll" SetRegView 64 WriteRegStr SHCTX "Software\Classes\CLSID\$DIFF_EXT_CLSID" "" "$DIFF_EXT_ID" WriteRegStr SHCTX "Software\Classes\CLSID\$DIFF_EXT_CLSID\InProcServer32" "" "$INSTDIR\$DIFF_EXT_DLL" WriteRegStr SHCTX "Software\Classes\CLSID\$DIFF_EXT_CLSID\InProcServer32" "ThreadingModel" "Apartment" WriteRegStr SHCTX "Software\Classes\*\shellex\ContextMenuHandlers\$DIFF_EXT_ID" "" "$DIFF_EXT_CLSID" WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "$DIFF_EXT_CLSID" "$DIFF_EXT_ID" WriteRegStr SHCTX "Software\Classes\Folder\shellex\ContextMenuHandlers\$DIFF_EXT_ID" "" "$DIFF_EXT_CLSID" WriteRegStr SHCTX "Software\Classes\Directory\shellex\ContextMenuHandlers\$DIFF_EXT_ID" "" "$DIFF_EXT_CLSID" SetRegView 32 ${EndIf} StrCpy $DIFF_EXT_CLSID ${DIFF_EXT32_CLSID} StrCpy $DIFF_EXT_DLL "diff_ext_for_kdiff3.dll" StrCpy $DIFF_EXT_OLD_DLL "diff_ext_for_kdiff3_old.dll" StrCpy $DIFF_EXT_ID "diff-ext-for-kdiff3" IfFileExists "$INSTDIR\$DIFF_EXT_OLD_DLL" 0 +2 Delete "$INSTDIR\$DIFF_EXT_OLD_DLL" IfFileExists "$INSTDIR\$DIFF_EXT_DLL" 0 +2 Rename "$INSTDIR\$DIFF_EXT_DLL" "$INSTDIR\$DIFF_EXT_OLD_DLL" File "32bit\diff_ext_for_kdiff3.dll" SetRegView 64 WriteRegStr HKCU "Software\KDiff3\diff-ext" "" "" WriteRegStr SHCTX "Software\KDiff3\diff-ext" "InstallDir" "$INSTDIR" WriteRegStr SHCTX "Software\KDiff3\diff-ext" "diffcommand" "$INSTDIR\kdiff3.exe" SetRegView 32 WriteRegStr SHCTX "Software\Classes\CLSID\$DIFF_EXT_CLSID" "" "$DIFF_EXT_ID" WriteRegStr SHCTX "Software\Classes\CLSID\$DIFF_EXT_CLSID\InProcServer32" "" "$INSTDIR\$DIFF_EXT_DLL" WriteRegStr SHCTX "Software\Classes\CLSID\$DIFF_EXT_CLSID\InProcServer32" "ThreadingModel" "Apartment" WriteRegStr SHCTX "Software\Classes\*\shellex\ContextMenuHandlers\$DIFF_EXT_ID" "" "$DIFF_EXT_CLSID" WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "$DIFF_EXT_CLSID" "$DIFF_EXT_ID" WriteRegStr SHCTX "Software\Classes\Folder\shellex\ContextMenuHandlers\$DIFF_EXT_ID" "" "$DIFF_EXT_CLSID" WriteRegStr SHCTX "Software\Classes\Directory\shellex\ContextMenuHandlers\$DIFF_EXT_ID" "" "$DIFF_EXT_CLSID" File "DIFF-EXT-LICENSE.txt" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Diff-Ext License.lnk" "$INSTDIR\DIFF-EXT-LICENSE.txt" SectionEnd Section "WinCVS" SecIntegrationWinCVS DetailPrint "Integration to WinCVS" #MessageBox MB_OK "If WinCVS is running, please close it before proceeding." WriteRegStr HKCU "Software\WinCvs\wincvs\CVS settings" "P_Extdiff" '$INSTDIR\kdiff3.exe' WriteRegBin HKCU "Software\WinCvs\wincvs\CVS settings" "P_DiffUseExtDiff" 01 SectionEnd Section "TortoiseSVN" SecIntegrationTortoiseSVN DetailPrint "Integration to TortoiseSVN" WriteRegStr HKCU "Software\TortoiseSVN\" "Diff" '$INSTDIR\kdiff3.exe %base %mine --L1 Base --L2 Mine' WriteRegStr HKCU "Software\TortoiseSVN\" "Merge" '$INSTDIR\kdiff3.exe %base %mine %theirs -o %merged --L1 Base --L2 Mine --L3 Theirs' SectionEnd Section /o "SVN Merge tool" SecIntegrationSubversionDiff3Cmd DetailPrint "Integrate diff3_cmd.bat for Subversion" File "diff3_cmd.bat" CreateDirectory '$APPDATA\Subversion' CopyFiles '$INSTDIR\diff3_cmd.bat' '$APPDATA\Subversion' SectionEnd SubSectionEnd ;-------------------------------- ;Installer Functions Function .onInit !insertmacro MUI_LANGDLL_DISPLAY !insertmacro MUI_INSTALLOPTIONS_EXTRACT "installForAllUsersPage.ini" FunctionEnd Function CustomPageC !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "installForAllUsersPage.ini" FunctionEnd ;-------------------------------- ;Descriptions ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGUAGE SPECIFIC ;Assign descriptions to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecSoftware} "Main program." !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} "English documentation in HTML-format (Docs for other languages are available on the homepage.)" !insertmacro MUI_DESCRIPTION_TEXT ${SecTranslations} "Translations for visible strings in many languages. Not needed for US-English." !insertmacro MUI_DESCRIPTION_TEXT ${SecUtilities} "Command Line Utilities: GNU sed, diff, diff3, etc. precompiled for Windows" !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegration} "Integrate KDiff3 with certain programs. (See also the Readme for details.)" !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegrationExplorer} "Integrate KDiff3 with Explorer. Adds an entry for KDiff3 in the Send-To context menu." !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegrationDiffExtForKDiff3} "Installs Diff-Ext by Sergey Zorin. Adds entries for KDiff3 in Explorer context menu." !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegrationWinCVS} "Integrate KDiff3 with WinCVS. (Please close WinCVS before proceeding.)" !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegrationTortoiseSVN} "Integrate KDiff3 with TortoiseSVN." !insertmacro MUI_DESCRIPTION_TEXT ${SecIntegrationSubversionDiff3Cmd} "Install diff3_cmd.bat for Subversion merge" !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- ;Uninstaller Section Section "Uninstall" ReadRegStr $INSTALL_FOR_ALL_USERS HKCU "Software\KDiff3" "InstalledForAllUsers" ;Set ShellVarContext: Defines if SHCTX points to HKLM or HKCU StrCmp $INSTALL_FOR_ALL_USERS "0" "" +3 SetShellVarContext current Goto +2 SetShellVarContext all Delete "$INSTDIR\Uninstall.exe" Delete "$INSTDIR\kdiff3.exe" Delete "$INSTDIR\kdiff3.exe.manifest" Delete "$INSTDIR\qt.conf" Delete "$INSTDIR\COPYING.txt" Delete "$INSTDIR\Readme_Win.txt" Delete "$INSTDIR\ChangeLog.txt" Delete "$INSTDIR\diff_ext_for_kdiff3.dll" Delete "$INSTDIR\diff_ext_for_kdiff3_old.dll" Delete "$INSTDIR\diff_ext_for_kdiff3_64.dll" Delete "$INSTDIR\diff_ext_for_kdiff3_64_old.dll" Delete "$INSTDIR\DIFF-EXT-LICENSE.txt" RMDir /r "$INSTDIR\doc" RMDir /r "$INSTDIR\translations" RMDir /r "$INSTDIR\bin" RMDir "$INSTDIR" # without /r the dir is only removed if completely empty !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\KDiff3.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\KDiff3-Qt4.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\Readme.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\GPL.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\Diff-Ext License.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\Documentation.lnk" Delete "$QUICKLAUNCH\KDiff3.lnk" Delete "$SENDTO\KDiff3.lnk" ;Delete empty start menu parent diretories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" startMenuDeleteLoop: ClearErrors RMDir $MUI_TEMP GetFullPathName $MUI_TEMP "$MUI_TEMP\.." IfErrors startMenuDeleteLoopDone StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop startMenuDeleteLoopDone: DeleteRegKey HKCU "Software\KDiff3" DeleteRegKey SHCTX "Software\KDiff3" DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\KDiff3" ; diff_ext_for_kdiff3 ${If} ${RunningX64} StrCpy $DIFF_EXT_CLSID ${DIFF_EXT64_CLSID} StrCpy $DIFF_EXT_ID "diff-ext-for-kdiff3-64" SetRegView 64 DeleteRegKey SHCTX "Software\Classes\CLSID\$DIFF_EXT_CLSID" DeleteRegKey SHCTX "Software\Classes\*\shellex\ContextMenuHandlers\$DIFF_EXT_ID" DeleteRegKey SHCTX "Software\Classes\Folder\shellex\ContextMenuHandlers\$DIFF_EXT_ID" DeleteRegKey SHCTX "Software\Classes\Directory\shellex\ContextMenuHandlers\$DIFF_EXT_ID" DeleteRegValue SHCTX "Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "$DIFF_EXT_CLSID" SetRegView 32 ${EndIf} StrCpy $DIFF_EXT_CLSID ${DIFF_EXT32_CLSID} StrCpy $DIFF_EXT_ID "diff-ext-for-kdiff3" DeleteRegKey SHCTX "Software\Classes\CLSID\$DIFF_EXT_CLSID" DeleteRegKey SHCTX "Software\Classes\*\shellex\ContextMenuHandlers\$DIFF_EXT_ID" DeleteRegKey SHCTX "Software\Classes\Folder\shellex\ContextMenuHandlers\$DIFF_EXT_ID" DeleteRegKey SHCTX "Software\Classes\Directory\shellex\ContextMenuHandlers\$DIFF_EXT_ID" DeleteRegValue SHCTX "Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "$DIFF_EXT_CLSID" SectionEnd ;-------------------------------- ;Uninstaller Functions Function un.onInit !insertmacro MUI_UNGETLANGUAGE FunctionEnd