home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / ira / fdiff.doc < prev    next >
Text File  |  2000-08-14  |  3KB  |  127 lines

  1.  
  2. FDiff version 1.00, copyright 1992 by Nicolas Dade.
  3.  
  4. All Rights Reserved. Permission is hereby granted for non-commercial
  5. duplication and distribution, and for dist ribution by BBSs which do
  6. not charge for downloads, and for distribution in dis k collections
  7. which charge a nominal fee per disk. This is not shareware.
  8.  
  9.  
  10.  
  11. ** what **
  12.  
  13. A fast diff.
  14.  
  15. It compares two text files on a line-by-line basis, outputing to
  16. STDOUT the lines which differ, with a "+ <line number> " precceding
  17. lines from the NEWFILE, and a "- <line number> " preceeding lines from
  18. the OLDFILE.
  19.  
  20. FDiff requires 2.04 and can only be used from a shell.
  21.  
  22.  
  23.  
  24. ** why **
  25.  
  26. I couldn't find a diff which didn't take _forever_ on my machine when
  27. comparing even short, simple files. So I wrote my own, in assembler of
  28. course, and now I don't understand how other diffs who's output is
  29. _identical_ to FDiff's can be so slow. But I doesn't effect me any
  30. more. :)
  31.  
  32.  
  33.  
  34. ** how **
  35.  
  36. Say you have changed a program's source, and now it doesn't work
  37. any more, and you did this over several days, so you can't remember
  38. every little thing you changed, you can ask FDiff to find those for
  39. you. In a shell, type
  40.  
  41.  FDiff newsource.asm oldsource.asm
  42.  
  43. and you will get a dump of all the lines you changed (you might want
  44. to redirect this to a file instead of to the screen).
  45.  
  46.  
  47.  
  48. ** fine details **
  49.  
  50. FDiff has only one optional parameter: RESYNC (it has only one
  51. internal parameter too: RESYNC, so don't think you're not being given
  52. control of everything). RESYNC is the number of consecutive matching
  53. lines which will be required before FDiff will consider the two files
  54. to be resynchronized. The default value is 5.
  55.  
  56. For example, if the file where:
  57.  
  58. newfile:
  59.  this        1
  60.  is        2
  61.  the        3
  62.  new        4
  63.  file's         5
  64.  best        6
  65.  line.        7
  66.  It        8
  67.  is        9
  68.  already    10
  69.  new.        11
  70.  
  71. oldfile:
  72.  this        1
  73.  is        2
  74.  the old    3
  75.  file's         4
  76.  best        5
  77.  line.        6
  78.  Is        7
  79.  it        8
  80.  already    9
  81.  old?        10
  82.  
  83. and you said "FDiff oldfile newfile 1" you'd get the output
  84.  
  85.  + 3    the
  86.  + 4    new
  87.  - 3    the old
  88.  
  89.  + 8    It
  90.  + 9    is
  91.  - 7    Is
  92.  - 8    it
  93.  
  94.  + 11    new.
  95.  - 10    old?
  96.  
  97. but if you said "FDiff oldfile newfile 2" you'd get the output
  98.  
  99.  + 3    the
  100.  + 4    new
  101.  - 3    the old
  102.  
  103.  + 8    It
  104.  + 9    is
  105.  + 10    already
  106.  + 11    new.
  107.  - 7    Is
  108.  - 8    it
  109.  - 9    already
  110.  - 10    old?
  111.  
  112. since the single matching line "already" is not enough to resync the
  113. files.
  114.  
  115.  
  116. When one file ends, the rest of the other file is outputed as changed
  117. lines.
  118.  
  119. There is no limit to the number of lines FDiff will look at when in
  120. search of a resync, except that they must all file in memory.
  121.  
  122. How fast is FDiff? Two 18K source files w/ 650 lines each, and 270
  123. differing lines takes 6 sec to diff on a 8 MHz 68000 machine (i.e.
  124. a plain jane A500 or A2000) with both files in ram:, and output
  125. redirected to a file in ram:.
  126.  
  127.