home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / FCMERG10.ZIP / FCMERGE.DOC next >
Text File  |  1993-07-14  |  16KB  |  391 lines

  1.  
  2.  
  3.                                  FCMERGE Ver. 1.0
  4.                           Copyright (c) 1993 Mike Albert
  5.                                      July 1993
  6.  
  7.  
  8.  
  9.      1   INTRODUCTION
  10.  
  11.      FCMERGE merges two sets of changes to an ASCII file into a single file.
  12.      FCMERGE is designed to handle program source files, but will also work
  13.      other types of files (e.g. English text).  E.g. if two programmers have
  14.      modified a program independently, FCMERGE will combine their changes
  15.      into a single source file.  If the changes conflict, FCMERGE identifies
  16.      the conflicts so the programmers can resolve them.
  17.  
  18.      Note that FCMERGE does it's best to identify conflicts accurately, but
  19.      there's no guarantee that all conflicts will be found.  Changes can
  20.      conflict even when they are not close to each other.  Since FCMERGE
  21.      identifies conflicts by the closeness of changes, it's not possible for
  22.      it to find conflicts with complete reliability.  You should always
  23.      examine your output to ensure that it is correct.  I suggest you use FC
  24.      (my file comparison utility) to compare each modified file with the
  25.      merged file.  You may also want to experiment with the -c<n> command
  26.      line option, which controls how close two changes must be to be marked
  27.      as conflicting.
  28.  
  29.  
  30.  
  31.      2   OPERATION
  32.  
  33.      To merge two sets of changes to a file into a single file:
  34.  
  35.          fcmerge  options  origfile  file1  file2  outfile
  36.      or:
  37.          fcmerge  options  origfile  file1  file2
  38.  
  39.      where:
  40.  
  41.          origfile    original file
  42.  
  43.          file1       first modified version of origfile
  44.  
  45.          file2       second modified version of origfile
  46.  
  47.          outfile     output file containing merged changes (if missing,
  48.                      output is to standard output)
  49.  
  50.      and options are:
  51.  
  52.          -c<n>       conflict proximity - if there are less than <n> lines
  53.                      between a change in file1 and file2, FCMERGE indicates
  54.                      that the changes conflict.  To mark fewer changes as
  55.                      conflicting make <n> smaller; to mark more, make <n>
  56.                      larger.  The default value of <n> is 5.
  57.  
  58.      For example, assume Mike changed file qsort.old to make file qsort.mik
  59.      and Pam made different changes to the same file to make file qsort.pam.
  60.      Then:
  61.  
  62.          fcmerge  -c8  qsort.old  qsort.mik  qsort.pam  qsort.new
  63.  
  64.  
  65.  
  66.                                        - 1 -
  67.  
  68.      merges both sets of changes and places the result in file qsort.new.
  69.      Changes that are separated by 8 lines or less are listed as conflicting.
  70.  
  71.  
  72.  
  73.      3   DETAILED OPERATION
  74.  
  75.      FCMERGE can be used on any IBM-compatible computer with MS-DOS versions
  76.      2.0 and later.  The amount of memory required is dependent on file size.
  77.      100K is enough for small files, while up to 425K is needed for large
  78.      ones.  Files containing up to 16,300 lines can be merged.
  79.  
  80.      The file names specify a drive and directory in the normal MS-DOS
  81.      manner.  If no drive is specified, FCMERGE looks for files on the
  82.      current drive.  If no directory is specified, FCMERGE looks in the
  83.      current directory.  MS-DOS wild-card characters can be used in all but
  84.      the first file name.
  85.  
  86.      FCMERGE only processes lines of up to 2,000 characters.  If FCMERGE
  87.      encounters a longer line, it breaks it after the 2,000th character to
  88.      make two separate lines.
  89.  
  90.      FCMERGE works by first determining the two sets of changes, and then
  91.      applying them together to the original file to make the merged file.
  92.      This works fine if the changes don't apply to the same lines of the
  93.      file.  But if two changes overlap, FCMERGE can't figure out how to
  94.      resolve the conflict.  E.g. if lines 3 to 8 were deleted in the first
  95.      change, and a line was inserted after line 5 in the second change, the
  96.      changes almost certainly conflict with each other.  FCMERGE checks for
  97.      such problems.  When it detects a conflict, it inserts an error message
  98.      in the output file, and then outputs the lines of the original file, the
  99.      lines of the first changed file, and the lines of second changed file.
  100.      FCMERGE also beeps and displays and error message on the screen when it
  101.      completes to warn you of the problem.  When this occurs you must examine
  102.      the file, search for the error message that identifies conflicts, and
  103.      change the file to resolve each conflict.
  104.  
  105.      A similar problem may occur if a change in one file is close to, but
  106.      doesn't overlap, a change in the second.   E.g. if line 5 has been
  107.      replaced in the first file and line 7 has been replaced in the second,
  108.      there's a reasonable chance that one change will effect the other and
  109.      cause a problem.  When this occurs, FCMERGE behaves as if the changes
  110.      actually overlapped.  Since there is no hard and fast rule for how many
  111.      lines may separate two changes without causing a problem, FCMERGE
  112.      provides the -c<n> option so you can specify this value yourself.  The
  113.      default value is 5.  If you find that FCMERGE is overly cautious in
  114.      identifying conflicts, you can specify a lesser value so FCMERGE will
  115.      mark fewer changes as conflicts.  If you find that FCMERGE is not
  116.      identifying conflicts that it should, you should specify a greater value
  117.      so FCMERGE will mark more changes as conflicts.
  118.  
  119.  
  120.  
  121.      4   FCMERGE MESSAGES
  122.  
  123.          Error: argument -<x> is invalid
  124.              FCMERGE couldn't recognize the argument you specified on the
  125.              command line (argument <x>).  Check the list of arguments that
  126.              FCMERGE accepts to determine what options you can use.  You can
  127.              list the options FCMERGE recognizes by typing "fcmerge ?".
  128.  
  129.  
  130.  
  131.                                       - 2 -
  132.  
  133.          Error: couldn't create output file <f>
  134.              FCMERGE couldn't create output file <f> which you specified on
  135.              the command line.  Make sure you specify the correct file name,
  136.              with the directory and drive if needed, on the command line.  If
  137.              you didn't specify a directory or drive, FCMERGE used the
  138.              current directory and drive.  Also make sure that you can write
  139.              to the directory, and that the drive has sufficient free space.
  140.  
  141.          Error: couldn't create difference file <f>
  142.          Error: couldn't open difference file <f>
  143.              FCMERGE couldn't create or open file <f>.  This file is created
  144.              by FCMERGE to store temporary information, and is deleted before
  145.              FCMERGE completes.  FCMERGE tries to create these files in the
  146.              current directory.  Make sure that the current directory is set
  147.              correctly, that you can write to and read from that directory,
  148.              and that the drive has sufficient free space.  If this message
  149.              occurs and you can't figure out how to correct the problem,
  150.              please contact FCMERGE support.
  151.  
  152.          Error: couldn't open file <f>
  153.              FCMERGE couldn't open file <f> which you specified on the
  154.              command line.  If you didn't specify a directory or drive,
  155.              FCMERGE looked in the current directory and drive.  Make sure
  156.              you specify the correct file name, with the directory and drive
  157.              if needed, on the command line.
  158.  
  159.          Error: more than four file names specified
  160.          Error: fewer than three file names specified
  161.              FCMERGE didn't find the right number of file names on the
  162.              command line.  You must specify either three names (the original
  163.              file and the two changed files) or four names (the original
  164.              file, the two changed files, and the output file) on the command
  165.              line.  If you forgot to specify the minus sign ("-") in front of
  166.              an option, FCMERGE interpreted it as an input file name.
  167.  
  168.          Error: more than 16,300 lines in file <f>
  169.              File <f>, which you specified on the command line, contains more
  170.              than 16,300 lines.  FCMERGE can only process files containing up
  171.              to 16,300 lines.
  172.  
  173.          Error: not enough memory to process these files
  174.              FCMERGE needs more memory to process these files than is
  175.              available.  The only way to correct this problem is to run on a
  176.              machine with more memory or remove any memory-resident programs.
  177.              This problem only occurs when comparing large files on machines
  178.              with small memory configurations.
  179.  
  180.          Error: some changes conflict with each other; search for "<<<" in
  181.          the output file
  182.              FCMERGE found one or more conflicts between the the two sets of
  183.              changes.  FCMERGE outputs a line starting with the characters
  184.              "<<<" noting the conflict, followed by the conflicting lines of
  185.              the original file, followed by a line of '-' characters,
  186.              followed by the conflicting lines of the first change file,
  187.              followed by another line of '-' characters, followed by the
  188.              conflicting lines of the second change file, followed by a final
  189.              line of '=' characters.  When you see this message, you must
  190.              search the output file for the "<<<" characters to find each
  191.              conflict, and merge the conflicting changes manually with a text
  192.              editor.
  193.  
  194.  
  195.  
  196.                                       - 3 -
  197.  
  198.          Error: the -c option value is not a number
  199.              FCMERGE couldn't recognize the value specified with the -c
  200.              option on the command line.  This option accepts one or more
  201.              decimal digits, e.g. -c10 to specify a conflict proximity of 10.
  202.  
  203.          Error: unexpected end of file reading difference file
  204.          Error: format error in difference file
  205.              FCMERGE encountered an error when reading a difference file.
  206.              The message indicates an internal error which is not caused by
  207.              the user, and should not occur in normal operation.  If it does,
  208.              please contact FCMERGE support.
  209.  
  210.          Error: output failed, disk probably full
  211.              FCMERGE detected an error when writing a file.  The file may be
  212.              either the output file specified on the command line, or a
  213.              temporary file created in the current directory.  The most
  214.              likely cause of this error is a full disk.  Make sure that the
  215.              output drive and the current drive have sufficient free space,
  216.              and that you can write there.
  217.  
  218.  
  219.      5   LICENSING, WARRANTY, and REGISTRATION
  220.  
  221.      FCMERGE is distributed as shareware.  I encourage you to try FCMERGE and
  222.      share it with friends as long as:
  223.  
  224.          The FCMERGE program and this documentation file are not modified and
  225.          are distributed together.
  226.  
  227.          FCMERGE is not provided as a part of any other product.
  228.  
  229.          No fees, beyond a reasonable fee for media, duplication, or
  230.          downloading costs, are charged.
  231.  
  232.          FCMERGE is not used for commercial, government, or business purposes
  233.          without registration.  Each registration is for a single person or a
  234.          single computer.
  235.  
  236.      If you find FCMERGE useful and decide to use it regularly, you are
  237.      required to register.  All registration payments will be donated to
  238.      Oxfam America, an international development and disaster relief agency.
  239.      It's a worthy charity that I've been supporting for many years.  For
  240.      more information on Oxfam see section 6.
  241.  
  242.      When you register you get the satisfaction of saving lives in Africa,
  243.      Asia, and South America, and encourage me to produce more software at
  244.      reasonable prices.  You also get the following benefits:
  245.  
  246.          I'll send an updated version of FCMERGE to you at no additional
  247.          cost.  You can request this at any time.  I'll do this once per
  248.          registered user.
  249.  
  250.          I'll answer questions on FCMERGE and its use.  You can contact me at
  251.          the address shown below or via CompuServe mail.
  252.  
  253.          If any important bugs are found I will notify you.
  254.  
  255.          I'll make an attempt (but can't guarantee) to fix any problems you
  256.          find.
  257.  
  258.  
  259.  
  260.  
  261.                                       - 4 -
  262.  
  263.      Registration is $25.  Please make your check payable to Oxfam America -
  264.      I'll send your checks to Oxfam and record your registration information.
  265.      I'll also accept original canceled checks or receipts from Oxfam that
  266.      list you as the donor.  Please send payments, registration information,
  267.      and any other correspondence to:
  268.  
  269.                 Mike Albert
  270.                 P. O. Box 535
  271.                 Bedford, MA   01730
  272.  
  273.      I can also be reached via CompuServe mail; my userid is [70325,1134].
  274.  
  275.      Anyone can order the latest version of FCMERGE directly from me for a
  276.      fee of $5.00.  Just send the order (make sure it contains your mailing
  277.      address) with your check to the above address.  You'll receive a 5 1/4
  278.      inch 360Kb floppy disk containing the executable and documentation
  279.      files.  If you need other formats (5 1/4 inch 1.2Mb or 3 1/2 inch 720Kb
  280.      or 1.44Mb) I can provide them.  I'll also include other shareware
  281.      products I produce.  If you live outside North America, please send
  282.      extra money for the increased postage.
  283.  
  284.      I welcome all comments and suggestions concerning FCMERGE.  I'd like to
  285.      know how you are using FCMERGE, where you obtained it, and what
  286.      problems, bugs, or weaknesses you find.  If you tell me about
  287.      enhancements or changes you're interested in, I'll make an effort to
  288.      provide them.
  289.  
  290.      This program is provided "as is" without warranty of any kind, either
  291.      express or implied, but not limited to the implied warranties of
  292.      merchantability or fitness for a particular purpose.  The entire risk as
  293.      to the results and performance of the program is assumed by the user.
  294.      Should the program prove defective, the user assumes the entire cost of
  295.      all necessary servicing, repair, or correction.
  296.  
  297.  
  298.  
  299.      6   OXFAM AMERICA
  300.  
  301.      As stated in Oxfam literature,
  302.  
  303.          "Oxfam America is an international agency that funds self-help
  304.          development projects and disaster relief in poor countries in
  305.          Africa, Asia, and Latin America, and also prepares and distributes
  306.          educational materials for people in the United States on the issues
  307.          of development and hunger.  The name "Oxfam" comes from the Oxford
  308.          Committee for Famine Relief, founded in England in 1942.  Oxfam
  309.          America, based in Boston, was formed in 1970, and is one of seven
  310.          autonomous Oxfams around the world (Great Britain, Australia,
  311.          Belgium, Canada, Quebec, Hong Kong and the United States).  Oxfam is
  312.          a nonsectarian, nonprofit agency that neither seeks or accepts U.S.
  313.          government funds.  All contributions are tax-deductible to the
  314.          extent permitted by law."
  315.  
  316.      For more information, you can phone Oxfam at 617-482-1211, or write to
  317.      them at:
  318.  
  319.                   Oxfam America
  320.                   26 West Street
  321.                   Boston, MA  02111-1206
  322.  
  323.  
  324.  
  325.  
  326.                                       - 5 -
  327.  
  328.      7   FCMERGE REVISION HISTORY
  329.  
  330.  
  331.          FCMERGE version 1.0 - 7/14/93
  332.  
  333.              Initial release of FCMERGE program.
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.                                       - 6 -