home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / utils / bug / 2095 < prev    next >
Encoding:
Text File  |  1992-11-21  |  3.4 KB  |  99 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!sauna.cs.hut.fi!jvh
  3. From: jvh@sauna.cs.hut.fi (Johannes Helander)
  4. Subject: diff 1.15 -N option
  5. Message-ID: <199211210626.AA27376@leia.cs.hut.fi>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Helsinki University of Technology, CS Lab.
  8. Distribution: gnu
  9. Date: Sat, 21 Nov 1992 10:26:53 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 86
  12.  
  13. IMHO, the -N option (+new-files) would be more useful if it would
  14. affect only files in the new directory. New files would get inserted
  15. in the diff, deleted files would not.
  16.  
  17. This is especially useful when using shadowed source trees where it
  18. doesn't make any sence to include unchanged files in the diff (which
  19. occurred to me when I got some 20 MB diffs where there really were
  20. only a few changes).
  21.  
  22. The following simple fixes implement this change.
  23.  
  24.     Johannes
  25.  
  26. *** ChangeLog.orig    Mon Nov 16 02:18:24 1992
  27. --- ChangeLog    Mon Nov 16 02:22:42 1992
  28. ***************
  29. *** 1,3 ****
  30. --- 1,10 ----
  31. + Mon Nov 16 02:18:42 1992  Johannes Helander  (jvh at leia.cs.hut.fi)
  32. +     * README: Fix description of -N flag.
  33. +     * diff.c (compare_files): Only print NEW files when -N flag is
  34. +     given. Do not print deleted files.
  35.   Sun Jan  6 18:42:23 1991  Michael I Bushnell  (mib at geech.ai.mit.edu)
  36.   
  37.       * Version 1.15 released.
  38. *** README.orig    Mon Nov 16 02:17:32 1992
  39. --- README    Mon Nov 16 02:18:11 1992
  40. ***************
  41. *** 80,87 ****
  42.       to affect neither label, just the first file's label, or both labels.
  43.       A file's default label is its name, a tab, and its modification date.
  44.   
  45. !    -N    in directory comparison, if a file is found in only one directory,
  46. !     treat it as present but empty in the other directory.
  47.   
  48.      -p    equivalent to -c -F'^[_a-zA-Z]'.  This is useful for C code
  49.       because it shows which function each change is in.
  50. --- 80,87 ----
  51.       to affect neither label, just the first file's label, or both labels.
  52.       A file's default label is its name, a tab, and its modification date.
  53.   
  54. !    -N    in directory comparison, if a file is found in only in the second
  55. !     directory, treat it as present but empty in the first directory.
  56.   
  57.      -p    equivalent to -c -F'^[_a-zA-Z]'.  This is useful for C code
  58.       because it shows which function each change is in.
  59. *** diff.c.orig    Mon Nov 16 02:11:40 1992
  60. --- diff.c    Mon Nov 16 02:27:52 1992
  61. ***************
  62. *** 451,457 ****
  63.        that exists only in one of the directories.
  64.        If so, just print a message to that effect.  */
  65.   
  66. !   if (! entire_new_file_flag && (name0 == 0 || name1 == 0))
  67.       {
  68.         char *name = name0 == 0 ? name1 : name0;
  69.         char *dir = name0 == 0 ? dir1 : dir0;
  70. --- 451,457 ----
  71.        that exists only in one of the directories.
  72.        If so, just print a message to that effect.  */
  73.   
  74. !   if (name1 == 0 || !entire_new_file_flag && name0 == 0)
  75.       {
  76.         char *name = name0 == 0 ? name1 : name0;
  77.         char *dir = name0 == 0 ? dir1 : dir0;
  78. ***************
  79. *** 631,637 ****
  80.   
  81.         if (inf[0].desc == -1 || inf[1].desc == -1)
  82.       {
  83. !       if (entire_new_file_flag && recursive)
  84.           val = diff_dirs (inf[0].name, inf[1].name, compare_files, depth,
  85.                    inf[0].desc == -1, inf[1].desc == -1);
  86.         else
  87. --- 631,637 ----
  88.   
  89.         if (inf[0].desc == -1 || inf[1].desc == -1)
  90.       {
  91. !       if (entire_new_file_flag && inf[1].dir_p && recursive)
  92.           val = diff_dirs (inf[0].name, inf[1].name, compare_files, depth,
  93.                    inf[0].desc == -1, inf[1].desc == -1);
  94.         else
  95.  
  96.