home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat1 / diff3.z / diff3
Encoding:
Text File  |  1998-10-20  |  4.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4. DDDDIIIIFFFFFFFF3333((((1111))))                                                              DDDDIIIIFFFFFFFF3333((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      diff3 - 3-way differential file comparison
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ddddiiiiffffffff3333 [ ----eeeexxxxEEEEXXXX3333 [----iiii | ----mmmm] [----LLLL label1 ----LLLL label3] ] file1 file2 file3
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      _D_i_f_f_3 compares three versions of a file, and publishes disagreeing ranges
  16.      of text flagged with these codes:
  17.  
  18.      ====            all three files differ
  19.  
  20.      ====1           _f_i_l_e_1 is different
  21.  
  22.      ====2           _f_i_l_e_2 is different
  23.  
  24.      ====3           _f_i_l_e_3 is different
  25.  
  26.      The type of change suffered in converting a given range of a given file
  27.      to some other is indicated in one of these ways:
  28.  
  29.      _f :::: _n_1 aaaa        Text is to be appended after line number _n_1 in file _f,
  30.                      where _f = 1, 2, or 3.
  31.  
  32.      _f :::: _n_1 ,,,, _n_2 cccc   Text is to be changed in the range line _n_1 to line _n_2.
  33.                      If _n_1 = _n_2, the range may be abbreviated to _n_1.
  34.  
  35.      The original contents of the range follows immediately after a cccc
  36.      indication.  When the contents of two files are identical, the contents
  37.      of the lower-numbered file is suppressed.
  38.  
  39.      The ----mmmm option produces a merge script on the output of _d_i_f_f_3.  If none of
  40.      ----eeeeEEEExxxxXXXX3333 is specified along with ----mmmm, then the format of option ----EEEE is
  41.      presumed.  If the ----mmmm option is used, then binary files, files without
  42.      trailing newline, and files with excessively long lines can be
  43.      successfully merged.
  44.  
  45.      If no ----mmmm option is specified, then under the ----eeee option, _d_i_f_f_3 publishes a
  46.      script for the editor _e_d(1) that will incorporate into _f_i_l_e_1 all changes
  47.      between _f_i_l_e_2 and _f_i_l_e_3, _i._e.  the changes that normally would be flagged
  48.      ==== and ====3.  Option ----xxxx (----3333) produces a script to incorporate only
  49.      changes flagged ==== (====3).  The following command will apply the
  50.      resulting script to `file1', and emit the result on the output stream.
  51.  
  52.                 (cat script; echo '1,$p') | ed - file1
  53.  
  54.      The ----EEEE and ----XXXX are similar to ----eeee and ----xxxx, respectively, but treat
  55.      overlapping changes (i.e., changes that would be flagged with ==== in the
  56.      normal listing) differently.  The overlapping lines from both files will
  57.      be inserted by the edit script, bracketed by "<<<<<<" and ">>>>>>" lines.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. DDDDIIIIFFFFFFFF3333((((1111))))                                                              DDDDIIIIFFFFFFFF3333((((1111))))
  71.  
  72.  
  73.  
  74.      For example, suppose lines 7-8 are changed in both file1 and file3.  The
  75.      merged output of the command
  76.  
  77.                            "diff3 -m file1 file2 file3"
  78.      contains:
  79.  
  80.           lines 1-6 of file1
  81.           <<<<<<< file1
  82.           lines 7-8 of file1
  83.           =======
  84.           lines 7-8 of file3
  85.           >>>>>>> file3
  86.           rest of file1
  87.  
  88.      If there are overlaps, the user should edit the result and delete one of
  89.      the alternatives.  If the ----LLLL _l_a_b_e_l_1 and ----LLLL _l_a_b_e_l_3 options are given, the
  90.      labels are output in place of the names _f_i_l_e_1 and _f_i_l_e_3 in overlap
  91.      reports.
  92.  
  93.      If the option ----iiii is specified along with one of the options ----eeeexxxxEEEEXXXX3333, then
  94.      the resulting edit script has the editor commands
  95.  
  96.                w
  97.                q
  98.  
  99.      added at the end.  Then the following command will update `file1' in
  100.      place with the changes.
  101.  
  102.                 ed - file1 < script
  103.  
  104. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  105.      diff(1), ed(1).
  106.  
  107. BBBBUUUUGGGGSSSS
  108.      If merges are done by generating explicit scripts to input to the editor,
  109.      rather than by using the ----mmmm option, the merge is limited by the
  110.      capabilities of the editor _e_d(1).  The editor cannot handle excessively
  111.      long lines, binary files (with nul bytes) or files without a trailing
  112.      newline.
  113.  
  114. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  115.      An exit status of 0 means _d_i_f_f_3 was successful, 1 means some overlaps
  116.      were found, and 2 means trouble.
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.