Warning, /sdk/kompare/doc/index.docbook is written in an unsupported language. File is not indexed.
0001 <?xml version="1.0" ?> 0002 <!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [ 0003 <!ENTITY % addindex "IGNORE"> 0004 <!ENTITY % English "INCLUDE"> 0005 ]> 0006 0007 <book id="kompare" lang="&language;"> 0008 0009 <bookinfo> 0010 <title>The &kompare; Handbook</title> 0011 0012 <authorgroup> 0013 0014 <author><firstname>Sean</firstname><surname>Wheller</surname><email>sean@inwords.co.za</email></author> 0015 <!-- TRANS:ROLES_OF_TRANSLATORS --> 0016 </authorgroup> 0017 0018 <copyright> 0019 <year>2007</year> 0020 <holder>Sean Wheller</holder> 0021 </copyright> 0022 0023 <legalnotice>&FDLNotice;</legalnotice> 0024 0025 <date>2016-07-05</date> 0026 <releaseinfo>4.1.3 (Applications 16.04)</releaseinfo> 0027 0028 <!-- Abstract about this handbook --> 0029 0030 <abstract> 0031 <para> 0032 &kompare; is a &GUI; front-end program that enables differences between source files to be viewed and merged. 0033 &kompare; can be used to compare differences on files or the contents of folders. &kompare; supports a variety 0034 of diff formats and provide many options to customize the information level displayed.</para> 0035 </abstract> 0036 0037 0038 <keywordset> 0039 <keyword>KDE</keyword> 0040 <keyword>Kompare</keyword> 0041 <keyword>Diff</keyword> 0042 <keyword>Merge</keyword> 0043 <keyword>Patch</keyword> 0044 <keyword>Hunk</keyword> 0045 </keywordset> 0046 0047 </bookinfo> 0048 0049 <chapter id="introduction"> 0050 <title>Introduction</title> 0051 0052 <para>When two or more people are working on a file and passing it back and forth between one another, it becomes difficult to 0053 see what changes have been made to a new version or copy of the file. Opening the new copy and the original, side-by-side in the 0054 application used to create it is one solution but, laborious, time consuming, and prone to error. This is where a program to show 0055 differences, diffs for short, is useful.</para> 0056 0057 <para>As would be expected, an appropriate name for such a program would be <quote>diff</quote>. As it happens, the program <ulink url="https://www.gnu.org/software/diffutils/">diff</ulink> is installed on 0058 most &Linux;-based systems and is used for exactly this purpose. Developers often use diff, as a command line tool, to show differences 0059 between versions of a source code file. However, the use of diff is not limited to showing differences in code source files, 0060 it can be used on many text-based file types.</para> 0061 0062 <para>Using diff from the command line can be confusing, learning the diff command syntax and deciphering the output can bewilder most people. 0063 This is where &kompare; comes into play. Providing a graphical front-end to the diff program, the interface displays source and destination files 0064 side-by-side with all differences automatically highlighted. From this starting point, changes in one file can be sequentially applied to the other file 0065 on a selective and controlled basis. Not all changes need to be applied and if you do apply a change it can always be 'unapplied'. 0066 When all required changes have been applied they can be saved and will display as normal in the original application used to create the file.</para> 0067 0068 <para>In addition to displaying differences between a source and destination file, &kompare; can be used to create and view a special file called a 'diff'. 0069 This file captures the differences between the two sources into a single file that can be used to view and apply changes to any other copy of the file. 0070 For example, if two people are editing a document. The first person wants to make changes and send just the changes made to the second person. 0071 Normally, the first person would send a complete copy of the modified document to the second person, who would then have to compare the modified document 0072 side-by-side with unmodified version. The process for this is much like what we have described in the previous paragraphs. With &kompare; the first person 0073 would first make a local copy of the file to be modified, then make changes and compare the original and modified copy. Now using &kompare; a diff file 0074 can be created that captures only the changes made. This can be sent to the second person in place of a whole file containing the changes.</para> 0075 0076 <para>Using &kompare; the second person can view the diff file, compare it to the local copy of the document and apply the changes made by the first person. 0077 So the process can go on for many versions of the document, each person making changes, creating diffs, distributing them and applying them. 0078 This process is commonly called <quote>patching</quote> , a term taken from the program named <quote>patch</quote> which is another command line 0079 tool specifically designed for the purpose of applying diff files.</para> 0080 0081 <para>It sometimes happens that people edit a file at the same time. In this situation it is likely that people will make changes in the document at 0082 exactly the same line. This creates a problem because, without applied caution, people could be overwriting each others work as they apply the diff files they receive. 0083 Fortunately the developers of the diff and patch programs took this into consideration and so these tools will not allow such changes to be applied without manual intervention. 0084 When this state is reached, it is known as a <quote>conflict</quote> . &kompare; will display conflicts so that you can manually resolve them, deciding 0085 which changes should be applied to which file.</para> 0086 0087 <para>&kompare; is also a great program for comparison of file changes on a folder level. When used to compare folders &kompare; recursively examines subfolders 0088 and their file contents for differences. In this use case, each file where differences are found are automatically opened and 0089 listed by &kompare; where easy navigation between the various files is possible.</para> 0090 0091 </chapter> 0092 0093 <chapter id="using"> 0094 <title>Using &kompare;</title> 0095 0096 <sect1 id="getting-started"> 0097 <title>Getting Started</title> 0098 0099 <para>This section provides instructions for starting &kompare; and provides a quick tour to the &kompare; main interface.</para> 0100 0101 <sect2 id="starting-kompare"> 0102 <title>Starting &kompare;</title> 0103 0104 <para>A shortcut for starting &kompare; can be found in the application menu in the Development group 0105 <menuchoice><guimenu>Development</guimenu><guimenuitem>Kompare</guimenuitem></menuchoice>.</para> 0106 0107 <para>When &kompare; starts the first thing it does is display a dialog from 0108 which to select the files you wish to compare. Special settings for the properties of the diff and the appearance thereof can also be selected. 0109 In the file form select a source and destination source to compare. This can be any two files, folders or a &URL; and a file. 0110 Once the source and destination are selected click the <guibutton>Compare</guibutton> button.</para> 0111 0112 <para>Once &kompare; has discovered the differences it will display the main interface. 0113 When comparing two files or a URL and a file the process takes just a few seconds. However, when comparing folders 0114 with many subfolders and files, this process can take awhile.</para> 0115 0116 <para>For explanation of the options available from diff and appearance forms see <xref linkend="configure-preferences"/>.</para> 0117 </sect2> 0118 0119 <sect2 id="main-interface"> 0120 <title>The Main Interface</title> 0121 0122 <para>This section provides a quick tour of the main interface which is comprised of the following areas:</para> 0123 <itemizedlist> 0124 <listitem><para>Menus</para></listitem> 0125 <listitem><para>Toolbar</para></listitem> 0126 <listitem><para>Source and Destination Folders</para></listitem> 0127 <listitem><para>Source and Destination Files</para></listitem> 0128 <listitem><para>Source and Destination Line Changes</para></listitem> 0129 <listitem><para>Source and Destination Text View</para></listitem> 0130 <listitem><para>Statusbar</para></listitem> 0131 </itemizedlist> 0132 0133 <sect3 id="menus"> 0134 <title>Menus</title> 0135 <para>&kompare; provides a menu driven interface. Explanation to the menu items and their options is provided in <xref linkend="command-reference"/>.</para> 0136 </sect3> 0137 0138 <sect3 id="toolbar"> 0139 <title>Toolbar</title> 0140 <para>The &kompare; toolbar provides shortcuts to the most frequently used diff and merge operations. 0141 The toolbar orientation, text positioning, icon size properties and which shortcut icons are displayed can be customized from the 0142 toolbar context menu accessed when right-clicking the toolbar with the mouse. The toolbar context menu also enables the toolbar to be hidden. 0143 If the toolbar is hidden and you wish to unhide it, select <menuchoice><guimenu>Settings</guimenu><guimenuitem>Show Toolbar</guimenuitem></menuchoice>.</para> 0144 </sect3> 0145 0146 <sect3 id="source-destination-folders"> 0147 <title>Source and Destination Folders</title> 0148 <para>The source folder and destination folder panes display the folders in which compared files reside. 0149 When many subfolders are included in the comparison, then selecting a folder will display the first document in 0150 that folder where a difference was found between the source and destination.</para> 0151 </sect3> 0152 0153 <sect3 id="source-destination-files"> 0154 <title>Source and Destination Files</title> 0155 <para>The source and destination file pane displays files where a difference was found for the currently selected source or destination folder. 0156 When a folder has multiple documents containing differences, all documents with a difference are listed. The selected document is displayed.</para> 0157 </sect3> 0158 0159 <sect3 id="source-destination-lines"> 0160 <title>Source and Destination Line Changes</title> 0161 <para>The source and destination line changes pane summarizes the differences found between the current source and destination documents. 0162 Selecting a record within the pane highlights and selects the difference. This is a useful way to navigate and inspect long documents with many differences.</para> 0163 </sect3> 0164 0165 <sect3 id="source-destination-view"> 0166 <title>Source and Destination View</title> 0167 <para>The source and destination view is the main workspace of &kompare;. 0168 The contents and highlighted differences of the currently selected source and destination file are displayed here with line numbers.</para> 0169 </sect3> 0170 0171 <sect3 id="text-view"> 0172 <title>Text View</title> 0173 <para>The <guilabel>Text View</guilabel> is not displayed by default. It can be opened by selecting 0174 <menuchoice><guimenu>Settings</guimenu><guimenuitem>Show Text View</guimenuitem></menuchoice>.</para> 0175 <!-- Other than a notepad, what is this text view good for? --> 0176 </sect3> 0177 0178 <sect3 id="statusbar"> 0179 <title>Statusbar</title> 0180 <para>The status bar provides a summary of the current source and destination file or folder under comparison. 0181 The status bar also reports the number of changes found in the current document and counts the differences that have been applied. 0182 Furthermore, the status bar shows the overall number of documents containing differences and the current document number selected from this set. 0183 For example, a comparison run over two folders may return 1890 files with differences. The currently selected document is number 18 of 1890.</para> 0184 </sect3> 0185 </sect2> 0186 </sect1> 0187 0188 <sect1 id="viewing-differences"> 0189 <title>Viewing Differences</title> 0190 0191 <sect2 id="managing-screen-real-estate"> 0192 <title>Managing Screen Real-Estate</title> 0193 <para>&kompare; displays the source and destination file under using equal percentage of the main interface view work area. 0194 This view area provides some features that help optimize use of screen real-estate while viewing differences, including:</para> 0195 <variablelist> 0196 <varlistentry> 0197 <term>Dual Scrollbars</term> 0198 <listitem><para>The most obvious feature is that scrollbars are provided both on the right and bottom edges of the view area. 0199 Using the scrollbars it is possible to move rapidly through the comparison.</para></listitem> 0200 </varlistentry> 0201 <varlistentry> 0202 <term>Share Grip Handle</term> 0203 <listitem><para>The vertical space between the source and destination view not only makes it possible to clearly see the start and end of lines in each of the panes, 0204 but is also a grip handle that allows adjustment of percentage occupied between the source and destination views that comprise the view pane. 0205 To change pane size for one of the views, hover the mouse pointer over the grip handle then hold down the mouse button and drag left or right. 0206 Naturally, increasing the area of one pane will decrease the area available to the opposite pane within the view panel area.</para> 0207 <para>A second horizontal handle is available between the navigation panel and the source and destination view.</para></listitem> 0208 </varlistentry> 0209 <varlistentry> 0210 <term>Docking</term> 0211 <listitem> 0212 <para>The navigation panel can be undocked from the main interface by clicking the <inlinemediaobject> 0213 <imageobject><imagedata fileref="undock.png" format="PNG"/></imageobject></inlinemediaobject> icon located top right of the panel. 0214 This opens it in a window of its own, allowing you to move it across the screen. 0215 You can even hide the navigation panel by clicking the <inlinemediaobject><imageobject><imagedata fileref="dock.png" format="PNG"/></imageobject></inlinemediaobject> icon. 0216 To display a hidden navigation bar again, click with the &RMB; into the menubar and select <guilabel>Navigation</guilabel> from the context menu. 0217 </para></listitem> 0218 </varlistentry> 0219 <varlistentry> 0220 <term>Statusbar Toggle</term> 0221 <listitem> 0222 <para>The status bar of the view panel can be toggled on and off by selecting <menuchoice><guimenu>Settings</guimenu><guimenuitem>Show Statusbar</guimenuitem></menuchoice>.</para> 0223 </listitem> 0224 </varlistentry> 0225 </variablelist> 0226 </sect2> 0227 0228 <sect2 id="switching-source-and-destination-view"> 0229 <title>Switching Source and Destination Views</title> 0230 0231 <para>Sometimes it can be useful to consider what the file to which differences where to be applied as the source. 0232 For example, when comparing two modified versions of a file and discovering that one file has many more modifications than the other. 0233 The file with more changes would be better as the source, since then fewer differences would need to be applied.</para> 0234 <para>In this case select <menuchoice><guimenu>File</guimenu><guimenuitem>Swap Source with Destination</guimenuitem></menuchoice>. 0235 This will switch the files displayed in all &kompare; panels.</para> 0236 </sect2> 0237 0238 <sect2 id="display-difference-statistics"> 0239 <title>Displaying Difference Statistics</title> 0240 <para>For a quick overview of the differences, select <menuchoice><guimenu>File</guimenu><guimenuitem>Show Statistics</guimenuitem></menuchoice>. 0241 This will display the <guilabel>Diff Statistics</guilabel> dialog. The following information is provided:</para> 0242 <variablelist> 0243 <varlistentry> 0244 <term><guilabel>Old file:</guilabel></term> 0245 <listitem><para>The file name of what is usually the source file or file that is unmodified.</para></listitem> 0246 </varlistentry> 0247 <varlistentry> 0248 <term><guilabel>New file:</guilabel></term> 0249 <listitem><para>The file name of what is usually the destination file or file that is modified and to which differences will be applied.</para></listitem> 0250 </varlistentry> 0251 <varlistentry> 0252 <term><guilabel>Format:</guilabel></term> 0253 <listitem><para>The diff format used to display the difference (see <xref linkend="diff-format"/>).</para></listitem> 0254 </varlistentry> 0255 <varlistentry> 0256 <term><guilabel>Number of hunks:</guilabel></term> 0257 <listitem> 0258 <para>The number of hunks found in the difference.</para> 0259 <para>A hunk is a <quote>c<emphasis>hunk</emphasis></quote> of lines that have been marked as different between 0260 source and destination and may include context lines depending on the diff format <guilabel>Lines of Context</guilabel> value (see <xref linkend="diff-format"/>).</para></listitem> 0261 </varlistentry> 0262 <varlistentry> 0263 <term><guilabel>Number of differences</guilabel></term> 0264 <listitem><para>The actual number of differences found, not hunks. A hunk can contain one or more differences 0265 when the line change range and the context lines of any two or more changes overlap.</para></listitem> 0266 </varlistentry> 0267 </variablelist> 0268 </sect2> 0269 0270 <sect2 id="navigating-the-difference-view"> 0271 <title>Navigating the Difference View</title> 0272 <para>&kompare; enables rapid navigation of differences on a file level and of multiple difference files when comparing folder trees.</para> 0273 0274 <sect3 id="selecting-a-difference"> 0275 <title>Selecting a Difference</title> 0276 <para>A difference can be selected using by:</para> 0277 <itemizedlist> 0278 <listitem><para>clicking a line in the Source and Destination Line Changes pane (top right of the main window).</para></listitem> 0279 <listitem><para>clicking the highlighted difference in the View pane.</para></listitem> 0280 <listitem><para>traversing the listed differences in a comparison (see <xref linkend="traversing-differences"/>).</para></listitem> 0281 </itemizedlist> 0282 <para>When a difference is selected it is considered to be <quote>in focus</quote> and is displayed in a brighter color that non-selected differences.</para> 0283 </sect3> 0284 0285 <sect3 id="traversing-differences"> 0286 <title>Traversing Differences</title> 0287 <para>When a comparison finds many differences one of the best ways to approach reviewing them is to traverse the differences in a logical order, usually from top to bottom.</para> 0288 <para>By default &kompare; selects the first difference found in a comparison. By selecting 0289 <menuchoice><guimenu>Difference</guimenu><guimenuitem>Next Difference</guimenuitem></menuchoice> 0290 (<keycombo action="simul">&Ctrl;<keycap>Down</keycap></keycombo>) the difference following the current selection is brought into focus. 0291 To select the difference before the current difference 0292 select <menuchoice><guimenu>Difference</guimenu><guimenuitem>Previous Difference</guimenuitem></menuchoice> 0293 (<keycombo action="simul">&Ctrl;<keycap>Up</keycap></keycombo>).</para> 0294 <para>In this way it is possible to traverse differences in an orderly manner, applying and unapply differences upon review.</para> 0295 </sect3> 0296 0297 <sect3 id="switching-between-files"> 0298 <title>Switching Between Files</title> 0299 <para>When a comparison is performed on folder level, many files may be found with differences. 0300 A complete list of the files compared with difference found is provided in the <quote>Source and Destination Folders</quote>, 0301 and <quote>Source and Destination Files</quote> panes. However, &kompare; displays differences between source and destination one comparison at time.</para> 0302 <para>To switch between documents in this scenario the following options are available:</para> 0303 <itemizedlist> 0304 <listitem><para>Select the <quote>Source and Destination Folders</quote> pane to display file differences found in the 0305 <quote>Source and Destination Files</quote> pane, then select a file.</para></listitem> 0306 <listitem><para>Select <menuchoice><guimenu>Difference</guimenu><guimenuitem>Previous File</guimenuitem></menuchoice> 0307 (<keycombo action="simul">&Ctrl;<keycap>PgUp</keycap></keycombo>) or 0308 <menuchoice><guimenu>Difference</guimenu><guimenuitem>Next File</guimenuitem></menuchoice> 0309 (<keycombo action="simul">&Ctrl;<keycap>PgDown</keycap></keycombo>) to 0310 display the previous or next difference file found in the <quote>Source and Destination Files</quote> pane.</para> 0311 </listitem> 0312 </itemizedlist> 0313 </sect3> 0314 </sect2> 0315 </sect1> 0316 0317 <sect1 id="merging-differences"> 0318 <title>Merging Differences</title> 0319 0320 <para>&kompare; makes the task of applying and unapplying differences as simple as point and click. 0321 Multiple apply and unapply operations can be performed on a difference as all operations are performed in memory and not written to the files on disk until the save operation is performed.</para> 0322 0323 <sect2 id="applying-a-difference"> 0324 <title>Applying a Difference</title> 0325 <para>To apply a difference, click the highlighted difference region, then select 0326 <menuchoice><guimenu>Difference</guimenu><guimenuitem>Apply Difference</guimenuitem></menuchoice> (<keycombo><keycap>Space</keycap></keycombo>).</para> 0327 </sect2> 0328 0329 <sect2 id="unapplying-a-difference"> 0330 <title>Unapplying a Difference</title> 0331 <para>To unapply a difference, click the highlighted difference region previously applied, then select 0332 <menuchoice><guimenu>Difference</guimenu><guimenuitem>Unapply Difference</guimenuitem></menuchoice> (<keycombo>&Backspace;</keycombo>).</para> 0333 </sect2> 0334 0335 <sect2 id="applying-all-differences"> 0336 <title>Applying All Differences</title> 0337 <para>After reviewing differences between files and finding all acceptable it is possible apply them all with a single operation by selecting 0338 <menuchoice><guimenu>Difference</guimenu><guimenuitem>Apply All</guimenuitem></menuchoice> (<keycombo action="simul">&Ctrl;<keycap>A</keycap></keycombo>).</para> 0339 </sect2> 0340 0341 <sect2 id="unapplying-all-differences"> 0342 <title>Unapplying All Differences</title> 0343 <para>To revert all differences that have been applied previously select 0344 <menuchoice><guimenu>Difference</guimenu><guimenuitem>Unapply All</guimenuitem></menuchoice> (<keycombo action="simul">&Ctrl;<keycap>U</keycap></keycombo>).</para> 0345 </sect2> 0346 0347 <sect2 id="saving-changes"> 0348 <title>Saving Changes</title> 0349 <para>Once differences have been applied they can be saved by selecting 0350 <menuchoice><guimenu>File</guimenu><guimenuitem>Save</guimenuitem></menuchoice> or 0351 <menuchoice><guimenu>File</guimenu><guimenuitem>Save All</guimenuitem></menuchoice>.</para> 0352 <para>Applied differences are saved to both the source and destination file.</para> 0353 </sect2> 0354 </sect1> 0355 0356 <sect1 id="working-with-diff-files"> 0357 <title>Working with Diff Files</title> 0358 <para>Diff files contain only the changes made between files, or a set of files within a folder system, and may or may not contain a number of context lines before and after line changes. 0359 The sum of a line change and its context lines is known a hunk. A diff file therefore may contain multiple hunks from one or more files. 0360 When the context lines of two or more hunks overlap, they are considered a single hunk. Diff files can be used to:</para> 0361 <itemizedlist> 0362 <listitem><para>Apply the changes contained in the hunks to an original file.</para></listitem> 0363 <listitem><para>Apply the changes contained in the hunks to a file or set of original files within a folder system.</para></listitem> 0364 <listitem><para>Modified before being applied to an original file or set of original files within a folder system.</para></listitem> 0365 </itemizedlist> 0366 0367 <sect2 id="creating-a-diff"> 0368 <title>Creating a Diff</title> 0369 <para>To create a diff file a comparison must be displayed in &kompare;. Assuming this is the case, then select <menuchoice><guimenu>File</guimenu><guimenuitem>Save Diff...</guimenuitem></menuchoice> 0370 This will display the <guilabel>Diff Options</guilabel> dialog (see <xref linkend="diff-settings"/> for more information on diff formats and options). 0371 After configuring these options, click the <guibutton>Save</guibutton> button and save the diff to a file with the extension <filename class="extension">.diff</filename>.</para> 0372 </sect2> 0373 0374 <sect2 id="displaying-a-diff"> 0375 <title>Displaying a Diff</title> 0376 <para>It is possible to display the contents of a diff file within &kompare; by opening the diff file from <menuchoice><guimenu>File</guimenu><guimenuitem>Open Diff...</guimenuitem></menuchoice>.</para> 0377 <para>When viewing a diff file the hunks between the source and destination file are shown, remember that only the hunks are shown, no unmodified lines will be shown. 0378 In some cases a diff file is created with 0 lines of context. In this case only the changed lines will be displayed.</para> 0379 <para>When a diff file contains hunks from multiple files &kompare; displays the hunks from each file one at a time and you can 0380 switch between files as though they were real files even though this information is only provided by the diff file contents.</para> 0381 </sect2> 0382 0383 <sect2 id="applying-a-diff"> 0384 <title>Applying Differences in a Diff File</title> 0385 <para>When viewing differences in a diff file it is possible to apply difference as you would when comparing source and destination files (see <xref linkend="merging-differences"/>).</para> 0386 </sect2> 0387 0388 <sect2 id="blending-a-diff"> 0389 <title>Blending a &URL; with a Diff</title> 0390 <para>In cases where a diff file is provided it is possible to compare the hunks in the diff against a file or folder. 0391 To do this select <menuchoice><guimenu>File</guimenu><guimenuitem>Blend URL with Diff...</guimenuitem></menuchoice>. 0392 Then input the <guilabel>File/Folder</guilabel> and <guilabel>Diff Output</guilabel> paths.</para> 0393 <para>When viewing differences between a source file and a diff file it is possible to apply difference as you would when comparing source and destination files (see <xref linkend="merging-differences"/>).</para> 0394 </sect2> 0395 0396 </sect1> 0397 </chapter> 0398 0399 <chapter id="configure-preferences"> 0400 <title>Configuring Preferences</title> 0401 0402 <para>&kompare; enables users to set appearance preferences for difference formatting in the main interface and set behavioral properties of the diff program. 0403 The <guilabel>Preferences</guilabel> dialog can be accessed by selecting 0404 <menuchoice><guimenu>Settings</guimenu><guisubmenu>Configure &kompare;...</guisubmenu></menuchoice>.</para> 0405 0406 <para>To configure preferences for appearance select the <guilabel>View</guilabel> menu item (see <xref linkend="view-settings"/>).</para> 0407 0408 <para>To configure preferences for diff program properties select the <guilabel>Diff</guilabel> menu item (see <xref linkend="diff-settings"/>).</para> 0409 0410 <sect1 id="view-settings"> 0411 <title>View Settings</title> 0412 <para>The <guimenu>View</guimenu> page in the <guilabel>Preferences</guilabel> dialog displays the <guilabel>Appearance</guilabel> 0413 and <guilabel>Fonts</guilabel> tabbed forms.</para> 0414 0415 <sect2 id="appearance"> 0416 <title>Appearance</title> 0417 <para>The <guilabel>Appearance</guilabel> form provides controls to manage the <guilabel>Colors</guilabel> used 0418 to denote difference in the main interface, behavior of the <guilabel>Mouse Wheel</guilabel> when jogging up and down 0419 and how <guilabel>Tabs to Spaces</guilabel> conversion is managed.</para> 0420 <screenshot> 0421 <screeninfo>&kompare; Appearance Settings</screeninfo> 0422 <mediaobject> 0423 <imageobject> 0424 <imagedata fileref="settings-view1.png" format="PNG"/> 0425 </imageobject> 0426 <textobject> 0427 <phrase>&kompare; Appearance Settings</phrase> 0428 </textobject> 0429 </mediaobject> 0430 </screenshot> 0431 <variablelist> 0432 <title>Color Group</title> 0433 <para>To adjust color preferences used when displaying differences, click the color button to display the <guilabel>Select Color</guilabel> dialog for the following states:</para> 0434 <varlistentry> 0435 <term><guilabel>Removed color</guilabel></term> 0436 <listitem><para>Lines that have been removed, do not exist, between source and destination.</para></listitem> 0437 </varlistentry> 0438 <varlistentry> 0439 <term><guilabel>Changed color</guilabel></term> 0440 <listitem><para>Lines that have been changed, modified, between source and destination. </para></listitem> 0441 </varlistentry> 0442 <varlistentry> 0443 <term><guilabel>Added color</guilabel></term> 0444 <listitem><para>Lines that have been added between source and destination.</para></listitem> 0445 </varlistentry> 0446 <varlistentry> 0447 <term><guilabel>Applied color</guilabel></term> 0448 <listitem><para>Any of the above states where the difference has been applied between source and destination.</para></listitem> 0449 </varlistentry> 0450 </variablelist> 0451 <variablelist> 0452 <title>Mouse Wheel</title> 0453 <varlistentry> 0454 <term><guilabel>Number of lines</guilabel></term> 0455 <listitem><para>The number of lines to jog the differences when turning the mouse wheel forward or backward.</para></listitem> 0456 </varlistentry> 0457 </variablelist> 0458 <variablelist> 0459 <title>Tabs to Spaces</title> 0460 <varlistentry> 0461 <term><guilabel>Number of spaces to convert a tab character to</guilabel></term> 0462 <listitem><para>Convert each tab character to n space characters.</para></listitem> 0463 </varlistentry> 0464 </variablelist> 0465 </sect2> 0466 0467 <sect2 id="fonts"> 0468 <title>Fonts</title> 0469 <screenshot> 0470 <screeninfo>&kompare; Fonts Settings</screeninfo> 0471 <mediaobject> 0472 <imageobject> 0473 <imagedata fileref="settings-view2.png" format="PNG"/> 0474 </imageobject> 0475 <textobject> 0476 <phrase>&kompare; Fonts Settings</phrase> 0477 </textobject> 0478 </mediaobject> 0479 </screenshot> 0480 <para>Select the font family and size to display when displaying differences.</para> 0481 </sect2> 0482 </sect1> 0483 0484 <sect1 id="diff-settings"> 0485 <title>Diff Settings</title> 0486 <para>The <guimenu>Diff</guimenu> page in the <guilabel>Preferences</guilabel> dialog displays the <guilabel>Diff</guilabel>, 0487 <guilabel>Format</guilabel>, <guilabel>Options</guilabel> and <guilabel>Exclude</guilabel> tabbed forms. These forms can be used to configure the 0488 behavioral properties of the Diff program.</para> 0489 0490 <sect2 id="diff"> 0491 <title>Diff</title> 0492 <screenshot> 0493 <screeninfo>&kompare; Diff Settings</screeninfo> 0494 <mediaobject> 0495 <imageobject> 0496 <imagedata fileref="settings-diff1.png" format="PNG"/> 0497 </imageobject> 0498 <textobject> 0499 <phrase>&kompare; Diff Settings</phrase> 0500 </textobject> 0501 </mediaobject> 0502 </screenshot> 0503 <para>The command used to run the diff program (default <application>diff</application>).</para> 0504 </sect2> 0505 0506 <sect2 id="diff-format"> 0507 <title>Format</title> 0508 <screenshot> 0509 <screeninfo>&kompare; Format Settings</screeninfo> 0510 <mediaobject> 0511 <imageobject> 0512 <imagedata fileref="settings-diff2.png" format="PNG"/> 0513 </imageobject> 0514 <textobject> 0515 <phrase>&kompare; Format Settings</phrase> 0516 </textobject> 0517 </mediaobject> 0518 </screenshot> 0519 <para>Adjust options for the <guilabel>Output Format</guilabel> and number of <guilabel>Lines of Context</guilabel>.</para> 0520 <variablelist> 0521 <title>Output Format</title> 0522 <varlistentry> 0523 <term><guilabel>Context</guilabel></term> 0524 <listitem> 0525 <para>The context output format adds several lines of context around the lines that differ.</para> 0526 </listitem> 0527 </varlistentry> 0528 0529 <varlistentry> 0530 <term><guilabel>Normal</guilabel></term> 0531 <listitem> 0532 <para>The normal output format displays differing lines without any surrounding lines of context. </para> 0533 </listitem> 0534 </varlistentry> 0535 0536 <varlistentry> 0537 <term><guilabel>Unified</guilabel></term> 0538 <listitem> 0539 <para>The unified output format is a variation on the context format. It is considered better than context because the 0540 output is more compact than that of context as it omits redundant context lines.</para> 0541 </listitem> 0542 </varlistentry> 0543 0544 </variablelist> 0545 <variablelist> 0546 <title>Lines of Context</title> 0547 <varlistentry> 0548 <term><guilabel>Number of context lines</guilabel></term> 0549 <listitem> 0550 <para>When performing a diff with context or unified output format use this parameter to control the number of context lines included.</para> 0551 </listitem> 0552 </varlistentry> 0553 </variablelist> 0554 </sect2> 0555 0556 <sect2 id="options"> 0557 <title>Options</title> 0558 <screenshot> 0559 <screeninfo>&kompare; Options Settings</screeninfo> 0560 <mediaobject> 0561 <imageobject> 0562 <imagedata fileref="settings-diff3.png" format="PNG"/> 0563 </imageobject> 0564 <textobject> 0565 <phrase>&kompare; Options Settings</phrase> 0566 </textobject> 0567 </mediaobject> 0568 </screenshot> 0569 <para>The <guilabel>Options</guilabel> tab form allows configuration of the options supported by the diff program.</para> 0570 <variablelist> 0571 <title>General</title> 0572 <varlistentry> 0573 <term><guilabel>Treat new files as empty</guilabel></term> 0574 <listitem><para>With this option enabled diff will treat a file that only exists in one of 0575 the directories as empty in the other directory. This means that the file is 0576 compared with an empty file and because of this will appear as one big 0577 insertion or deletion.</para></listitem> 0578 </varlistentry> 0579 <varlistentry> 0580 <term><guilabel>Look for smaller changes</guilabel></term> 0581 <listitem><para>Forces diff to display changes in case, punctuation, space, &etc; when checked.</para></listitem> 0582 </varlistentry> 0583 <varlistentry> 0584 <term><guilabel>Optimize for large files</guilabel></term> 0585 <listitem><para>Switches diff to process files with high-speed when checked.</para></listitem> 0586 </varlistentry> 0587 <varlistentry> 0588 <term><guilabel>Ignore changes in case</guilabel></term> 0589 <listitem><para>Lower and Uppercase character changes are omitted when this option is checked.</para></listitem> 0590 </varlistentry> 0591 </variablelist> 0592 <variablelist> 0593 <varlistentry> 0594 <term><guilabel>Ignore regexp</guilabel></term> 0595 <listitem><para>Ignore lines matching a regular expression.</para></listitem> 0596 </varlistentry> 0597 </variablelist> 0598 <variablelist> 0599 <title>Whitespace</title> 0600 <varlistentry> 0601 <term><guilabel>Expand tabs to spaces in output</guilabel></term> 0602 <listitem><para>When checked diff outputs will converts tab characters to the number of spaces defined in the 0603 <guilabel>Preferences</guilabel> dialog <guimenu>View</guimenu> menu <guilabel>Tabs to Spaces</guilabel> option.</para> 0604 </listitem> 0605 </varlistentry> 0606 <varlistentry> 0607 <term><guilabel>Ignore added or removed empty lines</guilabel></term> 0608 <listitem><para>lines of zero length that differ between source and destination are ignored when this option is checked.</para></listitem> 0609 </varlistentry> 0610 <varlistentry> 0611 <term><guilabel>Ignore changes in the amount of whitespace</guilabel></term> 0612 <listitem><para>White space before, after and between lines may change depending on different editors. 0613 When this option is checked such changes are ignored.</para></listitem> 0614 </varlistentry> 0615 <varlistentry> 0616 <term><guilabel>Ignore all whitespace</guilabel></term> 0617 <listitem><para>when checked white space differences are completely ignored.</para></listitem> 0618 </varlistentry> 0619 <varlistentry> 0620 <term><guilabel>Ignore changes due to tab expansion</guilabel></term> 0621 <listitem><para>when checked white space resulting from tab characters is ignored.</para></listitem> 0622 </varlistentry> 0623 </variablelist> 0624 </sect2> 0625 0626 <sect2 id="exclude"> 0627 <title>Exclude</title> 0628 <para>The <guilabel>Exclude</guilabel> form enables use of the filter options provided by the diff program.</para> 0629 <screenshot> 0630 <screeninfo>&kompare; Exclude Settings</screeninfo> 0631 <mediaobject> 0632 <imageobject> 0633 <imagedata fileref="settings-diff4.png" format="PNG"/> 0634 </imageobject> 0635 <textobject> 0636 <phrase>&kompare; Exclude Settings</phrase> 0637 </textobject> 0638 </mediaobject> 0639 </screenshot> 0640 <variablelist> 0641 <title>File Pattern to Exclude</title> 0642 <varlistentry> 0643 <term><guilabel>File Pattern to Exclude</guilabel></term> 0644 <listitem><para>Exclude files based on wild card filtering</para></listitem> 0645 </varlistentry> 0646 </variablelist> 0647 <variablelist> 0648 <title>File with Filenames to Exclude</title> 0649 <varlistentry> 0650 <term><guilabel>File with Filenames to Exclude</guilabel></term> 0651 <listitem><para>Define the filter based on the content of an externally managed file.</para></listitem> 0652 </varlistentry> 0653 </variablelist> 0654 </sect2> 0655 </sect1> 0656 0657 </chapter> 0658 0659 <chapter id="command-reference"> 0660 <title>Command Reference</title> 0661 0662 <sect1 id="menu-items"> 0663 0664 <title>Menu Items</title> 0665 <sect2 id="file-menu"> 0666 <title>The File Menu</title> 0667 <variablelist> 0668 <varlistentry> 0669 <term><menuchoice> 0670 <shortcut> 0671 <keycombo action="simul">&Ctrl;<keycap>O</keycap></keycombo> 0672 </shortcut> 0673 <guimenu>File</guimenu><guimenuitem>Open Diff...</guimenuitem></menuchoice></term> 0674 <listitem><para>Displays the <guilabel>Open</guilabel> dialog.</para></listitem> 0675 </varlistentry> 0676 0677 <varlistentry> 0678 <term><menuchoice> 0679 <shortcut> 0680 <keycombo action="simul">&Ctrl;<keycap>C</keycap></keycombo> 0681 </shortcut> 0682 <guimenu>File</guimenu><guimenuitem>Compare Files...</guimenuitem></menuchoice></term> 0683 <listitem><para>Displays the <guilabel>Compare Files or Folders</guilabel> dialog.</para></listitem> 0684 </varlistentry> 0685 0686 <varlistentry> 0687 <term><menuchoice> 0688 <shortcut> 0689 <keycombo action="simul">&Ctrl;<keycap>B</keycap></keycombo> 0690 </shortcut> 0691 <guimenu>File</guimenu><guimenuitem>Blend URL with Diff...</guimenuitem></menuchoice></term> 0692 <listitem><para>Displays the <guilabel>Blend File/Folder with diff Output</guilabel> dialog.</para></listitem> 0693 </varlistentry> 0694 0695 <varlistentry> 0696 <term><menuchoice> 0697 <shortcut> 0698 <keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo> 0699 </shortcut> 0700 <guimenu>File</guimenu><guimenuitem>Save</guimenuitem></menuchoice></term> 0701 <listitem><para>Writes applied differences to the current source and or destination file.</para></listitem> 0702 </varlistentry> 0703 0704 <varlistentry> 0705 <term><menuchoice><guimenu>File</guimenu><guimenuitem>Save All</guimenuitem></menuchoice></term> 0706 <listitem><para>Writes applied differences to all source and or destination files.</para></listitem> 0707 </varlistentry> 0708 0709 <varlistentry> 0710 <term><menuchoice><guimenu>File</guimenu><guimenuitem>Save Diff...</guimenuitem></menuchoice></term> 0711 <listitem><para>Displays the <guilabel>Diff Options</guilabel> dialog to define diff format and options.</para></listitem> 0712 </varlistentry> 0713 0714 <varlistentry> 0715 <term><menuchoice> 0716 <shortcut><keycap>F5</keycap></shortcut> 0717 <guimenu>File</guimenu><guimenuitem>Refresh Diff</guimenuitem></menuchoice></term> 0718 <listitem><para>Updates the difference of the original paths. Useful if you have applied 0719 some changes, saved them and want to see what is left.</para></listitem> 0720 </varlistentry> 0721 0722 <varlistentry> 0723 <term><menuchoice><guimenu>File</guimenu><guimenuitem>Swap Source with Destination</guimenuitem></menuchoice></term> 0724 <listitem><para>Changes source and destination.</para></listitem> 0725 </varlistentry> 0726 0727 <varlistentry> 0728 <term><menuchoice> 0729 <guimenu>File</guimenu><guimenuitem>Show Statistics</guimenuitem></menuchoice></term> 0730 <listitem><para>Displays the <guilabel>Display Statistics</guilabel> dialog.</para></listitem> 0731 </varlistentry> 0732 0733 <varlistentry> 0734 <term><menuchoice> 0735 <shortcut> 0736 <keycombo action="simul">&Ctrl;<keycap>Q</keycap></keycombo> 0737 </shortcut> 0738 <guimenu>File</guimenu><guimenuitem>Quit</guimenuitem></menuchoice></term> 0739 <listitem><para>Exits &kompare;.</para></listitem> 0740 </varlistentry> 0741 </variablelist> 0742 </sect2> 0743 0744 <sect2 id="difference-menu"> 0745 <title>The Difference Menu</title> 0746 <variablelist> 0747 <varlistentry> 0748 <term><menuchoice> 0749 <shortcut> 0750 <keycombo action="simul">&Ctrl;<keycap>U</keycap></keycombo> 0751 </shortcut> 0752 <guimenu>Difference</guimenu><guimenuitem>Unapply All</guimenuitem></menuchoice></term> 0753 <listitem><para>Unapply all differences previously applied between source and destination.</para></listitem> 0754 </varlistentry> 0755 0756 <varlistentry> 0757 <term><menuchoice> 0758 <shortcut>&Backspace;</shortcut> 0759 <guimenu>Difference</guimenu><guimenuitem>Unapply Difference</guimenuitem></menuchoice></term> 0760 <listitem><para>Revert a selected difference previously applied.</para></listitem> 0761 </varlistentry> 0762 0763 <varlistentry> 0764 <term><menuchoice> 0765 <shortcut><keycap>Space</keycap></shortcut> 0766 <guimenu>Difference</guimenu><guimenuitem>Apply Difference</guimenuitem></menuchoice></term> 0767 <listitem><para>Apply a selected difference.</para></listitem> 0768 </varlistentry> 0769 0770 <varlistentry> 0771 <term><menuchoice> 0772 <shortcut> 0773 <keycombo action="simul">&Ctrl;<keycap>A</keycap></keycombo> 0774 </shortcut> 0775 <guimenu>Difference</guimenu><guimenuitem>Apply All</guimenuitem></menuchoice></term> 0776 <listitem><para>Apply all differences between source and destination.</para></listitem> 0777 </varlistentry> 0778 0779 <varlistentry> 0780 <term><menuchoice> 0781 <shortcut> 0782 <keycombo action="simul">&Ctrl;<keycap>PgUp</keycap></keycombo> 0783 </shortcut> 0784 <guimenu>Difference</guimenu><guimenuitem>Previous File</guimenuitem></menuchoice></term> 0785 <listitem><para>Make the previous difference, in the list of differences, the current file in the view pane.</para></listitem> 0786 </varlistentry> 0787 0788 <varlistentry> 0789 <term><menuchoice> 0790 <shortcut> 0791 <keycombo action="simul">&Ctrl;<keycap>PgDown</keycap></keycombo> 0792 </shortcut> 0793 <guimenu>Difference</guimenu><guimenuitem>Next File</guimenuitem></menuchoice></term> 0794 <listitem><para>Make the next difference, in the list of differences, the current file in the view pane.</para></listitem> 0795 </varlistentry> 0796 0797 <varlistentry> 0798 <term><menuchoice> 0799 <shortcut> 0800 <keycombo action="simul">&Ctrl;<keycap>Up</keycap></keycombo> 0801 </shortcut> 0802 <guimenu>Difference</guimenu><guimenuitem>Previous Difference</guimenuitem></menuchoice></term> 0803 <listitem><para>Select the difference above the currently selected difference.</para></listitem> 0804 </varlistentry> 0805 0806 <varlistentry> 0807 <term><menuchoice> 0808 <shortcut> 0809 <keycombo action="simul">&Ctrl;<keycap>Down</keycap></keycombo> 0810 </shortcut> 0811 <guimenu>Difference</guimenu><guimenuitem>Next Difference</guimenuitem></menuchoice></term> 0812 <listitem><para>Select the difference below the currently selected difference.</para></listitem> 0813 </varlistentry> 0814 </variablelist> 0815 </sect2> 0816 0817 <sect2 id="settingshelpmenu"> 0818 0819 <title>The Settings and Help Menu</title> 0820 <para> 0821 &kompare; has the common &kde; <guimenu>Settings</guimenu> and <guimenu>Help</guimenu> 0822 menu items, for more information read the sections about the <ulink url="help:/fundamentals/menus.html#menus-settings" 0823 >Settings Menu</ulink> and <ulink url="help:/fundamentals/menus.html#menus-help">Help Menu</ulink> 0824 of the &kde; Fundamentals. 0825 </para> 0826 </sect2> 0827 </sect1> 0828 0829 <sect1 id="commandline-options"> 0830 <title>Commandline Options</title> 0831 0832 <variablelist> 0833 <varlistentry> 0834 <term>-c</term> 0835 <listitem><para>This will compare URL1 with URL2.</para></listitem> 0836 </varlistentry> 0837 0838 <varlistentry> 0839 <term><userinput><command>kompare</command> 0840 <option>-o</option></userinput></term> 0841 <listitem><para>This will open URL1 and expect it to be diff 0842 output. URL1 can also be a '-' and then it will 0843 read from standard input. Can be used for 0844 instance for <userinput><command>cvs diff | kompare -o -</command></userinput>. Kompare 0845 will do a check to see if it can find the 0846 original file(s) and then blend the original 0847 file(s) into the diffoutput and show that in 0848 the viewer. <option>-n</option> disables the check.</para></listitem> 0849 </varlistentry> 0850 0851 <varlistentry> 0852 <term><userinput><command>kompare</command> 0853 <option>-b</option></userinput></term> 0854 <listitem><para>This will blend URL2 into URL1, URL2 is 0855 expected to be diff output and URL1 the file or 0856 folder that the diffoutput needs to be blended 0857 into.</para></listitem> 0858 </varlistentry> 0859 0860 <varlistentry> 0861 <term><userinput><command>kompare</command> 0862 <option>-n</option></userinput></term> 0863 <listitem><para>Disables the check for automatically finding 0864 the original file(s) when using '-' as URL with 0865 the <option>-o</option> option.</para></listitem> 0866 </varlistentry> 0867 0868 <varlistentry> 0869 <term><userinput><command>kompare</command> 0870 <option>-e</option> <replaceable>encoding</replaceable></userinput></term> 0871 <listitem><para>Use this to specify the encoding when 0872 calling it from the command line. It will 0873 default to the local encoding if not 0874 specified.</para></listitem> 0875 </varlistentry> 0876 0877 </variablelist> 0878 0879 </sect1></chapter> 0880 0881 <chapter id="credits"> 0882 0883 <title>Credits and License</title> 0884 0885 <para> 0886 &kompare; 0887 </para> 0888 <para> 0889 Program copyright 2001-2004, &John.Firebaugh; &John.Firebaugh.mail; 0890 and Otto Bruggeman <email>otto.bruggeman@home.nl</email> 0891 </para> 0892 0893 <para> 0894 Documentation Copyright © 2007 Sean Wheller <email>sean@inwords.co.za</email> 0895 </para> 0896 0897 <!-- TRANS:CREDIT_FOR_TRANSLATORS --> 0898 0899 &underFDL; <!-- FDL: do not remove --> 0900 &underGPL; <!-- GPL License --> 0901 0902 </chapter> 0903 0904 &documentation.index; 0905 </book> 0906 0907 <!-- 0908 Local Variables: 0909 mode: sgml 0910 sgml-minimize-attributes:nil 0911 sgml-general-insert-case:lower 0912 sgml-indent-step:0 0913 sgml-indent-data:nil 0914 End: 0915 0916 // vim:ts=2:sw=2:tw=78:noet 0917 -->