Annotation of 43BSDReno/usr.bin/diff/diff3/diff3.1, revision 1.1.1.1

1.1       root        1: .\" Copyright (c) 1990 The Regents of the University of California.
                      2: .\" All rights reserved.
                      3: .\"
                      4: .\" Redistribution and use in source and binary forms are permitted provided
                      5: .\" that: (1) source distributions retain this entire copyright notice and
                      6: .\" comment, and (2) distributions including binaries display the following
                      7: .\" acknowledgement:  ``This product includes software developed by the
                      8: .\" University of California, Berkeley and its contributors'' in the
                      9: .\" documentation or other materials provided with the distribution and in
                     10: .\" all advertising materials mentioning features or use of this software.
                     11: .\" Neither the name of the University nor the names of its contributors may
                     12: .\" be used to endorse or promote products derived from this software without
                     13: .\" specific prior written permission.
                     14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
                     15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
                     16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     17: .\"
                     18: .\"     @(#)diff3.1    6.4 (Berkeley) 7/24/90
                     19: .\"
                     20: .Dd July 24, 1990
                     21: .Dt DIFF3 1
                     22: .Os BSD 4.3+Reno
                     23: .Sh NAME
                     24: .Nm diff3
                     25: .Nd 3-way differential file comparison
                     26: .Sh SYNOPSIS
                     27: .Nm diff3
                     28: .Op Fl exEX3
                     29: .Ar file1 file2 file3
                     30: .Sh DESCRIPTION
                     31: The
                     32: .Nm diff3
                     33: utility compares the contents of three different versions of a file,
                     34: .Ar file1 ,
                     35: .Ar file2
                     36: and
                     37: .Ar file3 ,
                     38: writing the result to the standard output.
                     39: The options describe different methods of merging and
                     40: purging
                     41: the separate versions into a new file.
                     42: .Nm Diff3
                     43: is used by
                     44: .Xr RCS 1
                     45: to merge specific versions or create
                     46: new versions.
                     47: .Pp
                     48: Options are:
                     49: .Tp Fl e
                     50: Produces output in a form suitable as an input script for the
                     51: .Xr ed 1
                     52: utility.  The script may then be used to merge differences common
                     53: between all three files and differences specific to file1 and file3.
                     54: In other words, the
                     55: .Fl e
                     56: option ignores differences specific to file1 and file2, and those
                     57: specific to file2 and file3.  It is useful for backing out changes
                     58: specific to file2 only.
                     59: .Tp Fl x
                     60: Produces an output script suitable for
                     61: .Xr ed 1
                     62: with changes
                     63: specific only to all three versions.
                     64: .Tp Fl 3
                     65: Produces an output script suitable for
                     66: .Xr ed 1
                     67: with changes
                     68: specific only to file3.
                     69: .Tp Fl E , X
                     70: Similar to
                     71: .Fl e
                     72: and
                     73: .Fl x  ,
                     74: respectively, but treat overlapping changes (i.e., changes that would
                     75: be noted with ==== in the normal listing) differently.  The overlapping
                     76: lines from both files will be inserted by the edit script, bracketed
                     77: by "<<<<<<" and ">>>>>>" lines.
                     78: .Tp
                     79: .Pp
                     80: The
                     81: .Fl E
                     82: option is used by RCS
                     83: .Xr merge  1
                     84: to insure that overlapping changes in the merged files are preserved
                     85: and brought to someone's attention.
                     86: .Pp
                     87: For example, suppose lines 7-8 are changed in both file1 and file2.
                     88: Applying the edit script generated by the command
                     89: .Pp
                     90: .Dl diff3 -E file1 file2 file3
                     91: .Pp
                     92: to file1 results in the file:
                     93: .Ds I
                     94: lines 1-6
                     95: of file1
                     96: <<<<<<< file1
                     97: lines 7-8
                     98: of file1
                     99: =======
                    100: lines 7-8
                    101: of file3
                    102: >>>>>>> file3
                    103: rest of file1
                    104: .De
                    105: .Pp
                    106: The default output of
                    107: .Nm diff3
                    108: makes notation of the differences between all files, and those differences
                    109: specific to each pair of files. The
                    110: changes are described by
                    111: the commands neccessary for
                    112: .Xr ed 1 
                    113: to create the desired target from the different versions.
                    114: See
                    115: .Xr diff 1
                    116: for a description of the commands.
                    117: .Tw Fl
                    118: .Tp Li \&====
                    119: The lines beneath this notation are ranges of lines which are different
                    120: between all files.
                    121: .Tc Li \&====
                    122: .Va n
                    123: .Cx
                    124: The lines beneath this notation are ranges of lines which are exclusively
                    125: different in file
                    126: .Va n .
                    127: .Tp
                    128: .\" .Sh EXAMPLES
                    129: .\" .Pp
                    130: .\" If three files were to contain:
                    131: .\" .Ds I
                    132: .\" .Cw  mooxthree mooxthree mooxthree
                    133: .\" .Cl file1  file2   file3
                    134: .\" .Cl moo    moo     moo
                    135: .\" .Cl moo too        moon    moon
                    136: .\" .Cl moo three      moo moo moo moo
                    137: .\" .Cl tangent        beam    milk
                    138: .\" .Cl moo moo        sun     butter
                    139: .\" .Cl \tcloud        beam
                    140: .\" .Cl \tmoo moo
                    141: .\" .Cl \tmoo moo
                    142: .\" .Cw
                    143: .\" .De
                    144: .\" .Pp
                    145: .\" The command line
                    146: .\" .Pp
                    147: .\" .Dl diff3 -e file1 file2 file3
                    148: .\" .Pp
                    149: .\" produces the following ed script:
                    150: .\" .Pp
                    151: .\" .Ds C
                    152: .\" ====1
                    153: .\" 1:2,4c
                    154: .\"   moo two
                    155: .\"   moo three
                    156: .\"   tangent
                    157: .\" 2:2c
                    158: .\" 3:2c
                    159: .\"   moon
                    160: .\" ====
                    161: .\" 1:5a
                    162: .\" 2:4,8c
                    163: .\"   beam
                    164: .\"   sun
                    165: .\"   cloud
                    166: .\"   moo moo
                    167: .\"   moo moo
                    168: .\" 3:4,6c
                    169: .\"   milk
                    170: .\"   butter
                    171: .\"   beam
                    172: .\" .De
                    173: .Sh FILES
                    174: .Dw /usr/bin/diff3
                    175: .Di L
                    176: .Dp Pa /tmp/d3?????
                    177: temporary files.
                    178: .Dp Pa /usr/bin/diff3
                    179: the executable.
                    180: .Dp
                    181: .Sh SEE ALSO
                    182: .Xr diff 1
                    183: .Xr ed 1
                    184: .Xr rcs 1
                    185: .Sh HISTORY
                    186: .Nm Diff3
                    187: appeared in Version 7 AT&T Unix.
                    188: .Sh BUGS
                    189: The
                    190: .Fl e
                    191: option
                    192: cannot catch and change
                    193: lines which have
                    194: .Sq Li \&.
                    195: as the first ans only character on the line.
                    196: The resulting script will fail on that line
                    197: as the
                    198: .Sq Li \&.
                    199: is an
                    200: .Xr ed 1
                    201: editing command.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.