Hi again.

> There are two enhancements I would like to see, both connected with
> the stuff it ignores on import and update:

>  1. cvs already ignores *.Z archives, so can it also be set to
>     ignore *.bz2 and *.gz archives as well.
> 
>  2. Can CVS be 'trained' to differentiate between directories and
>     files for the various ignore entries? One obvious way to me
>     would be to say that if the entry in the list of files to ignore
>     ends with a / then that refers to a directory to be ignored, and
>     any entry not ending with this character refers to a file. This
>     would mean that to ignore something as both, it would need to be
>     entered twice, once in each format.
> 
>     I will add that on looking at ignore.c I get the impression that
>     something along these lines has already been a\dded, but just 
>     doesn't work.
> 
> Comments anybody?

The enclosed patch both implements and documents (1) and additionally
adds several other archive formats that I am aware of. In addition, it
starts the procedure for implementing (2) as it puts the default entries
to ignore into two lists, one of directories to ignore and another of
files to ignore, although the current code justs inserts both of the
lists of defaults into the same list of entries to be ignored.

This patch is against the current CVS tree as of right now, so should
apply cleanly. It includes a CHANGELOG entry describing what it does.

Again, comments anybody?

Best wishes from Riley.
Index: ChangeLog
===================================================================
RCS file: /cvs/ccvs/ChangeLog,v
retrieving revision 1.620
diff -u -u -r1.620 ChangeLog
--- ChangeLog   18 Oct 2001 15:50:42 -0000      1.620
+++ ChangeLog   24 Oct 2001 22:16:01 -0000
@@ -1,3 +1,14 @@
+2001-10-22  Riley Williams <[EMAIL PROTECTED]>
+
+       * Separated directories and files in list of ignore patters, ready to
+         start development of patterns that only match directories and other
+         patterns that only match files.
+       * Documented where the various ignore patterns come from, listing the
+         ones I don't recognise as being unrecognised.
+       * Added various archive extensions to the list of files ignored as
+         standard to complement the *.Z entry already there.
+       * Added RPM command detrius to the list of files ignored as standard.
+
 2001-10-18  Derek Price  <[EMAIL PROTECTED]>
 
        * TESTS: Remove outdated note about tests that don't use the dotest
@@ -24,8 +35,8 @@
        * Makefile.am (AUTOMAKE_OPTIONS): Updated to require Automake 1.5.
        * NEWS (Changes since 1.11.1p1): Added note about standardizing on
        Automake 1.5.
-       * INSTALL (Building from source code under UNIX): It's Automake version
-       `1.5', not `2.5'.
+       * INSTALL (Building from source code under UNIX): It's Automake
+       version `1.5', not `2.5'.
        (Detailed information about your interaction with "configure"): Added
        note about using `configure --help'.
        * README (Installation): Add noautoconf.sh to the list of build and
Index: src/ignore.c
===================================================================
RCS file: /cvs/ccvs/src/ignore.c,v
retrieving revision 1.37
diff -u -u -r1.37 ignore.c
--- src/ignore.c        4 Apr 2001 16:52:55 -0000       1.37
+++ src/ignore.c        24 Oct 2001 22:16:05 -0000
@@ -33,12 +33,40 @@
 static int ign_hold = -1;              /* Index where first "temporary" item
                                         * is held */
 
-const char *ign_default = ". .. core RCSLOG tags TAGS RCS SCCS .make.state\
- .nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm .del-* *.a *.olb *.o *.obj\
- *.so *.Z *~ *.old *.elc *.ln *.bak *.BAK *.orig *.rej *.exe _$* *$";
+/*
+ * List of directories to ignore by default. These include:
+ *
+ *   System dirs:      . ..
+ *
+ *   CVS dirs:         CVS
+ *   RCS dirs:         RCS
+ *   SCCS dirs:        SCCS
+ */
+
+const char *ign_dir_default = ". .. CVS RCS SCCS";
+
+/*
+ * List of non-directory files to ignore by default. These include:
+ *
+ *   Archives:         *.arc *.arj *.bz2 *.gz *.Z *.z *.zip *.zoo
+ *   CVS/RCS files:    CVS.adm cvslog.* RCSLOG TAGS tags *,v
+ *   Compile detrius:  *.a *.exe *.o *.obj .make.state .nse.depinfo
+ *   Core dumps:       core
+ *   Editor backups:   *~ *.bak *.BAK *.old #* .#* ,* _$* *$
+ *   Linux system:     *.so
+ *   Patch leftovers:  *.orig *.rej
+ *   RPM detrius:      *.rpmorig *.rpmsave
+ *   Temporary files:  *.TMP *.tmp
+ *
+ *   Unrecognised:     .del-* *.olb *.elc *.ln
+ */
+
+const char *ign_file_default = "*.arc *.arj *.bz2 *.gz *.Z *.z *.zip *.zoo\
+ CVS.adm cvslog.* RCSLOG TAGS tags *,v *.a *.exe *.o *.obj .make.state\
+ .nse.depinfo core *~ *.bak *.BAK *.old #* .#* ,* _$* *$ *.so *.orig *.rej\
+ *.rpmorig *.rpmsave *.TMP *.tmp .del-* *.olb *.elc *.ln";
 
-#define IGN_GROW 16                    /* grow the list by 16 elements at a
-                                        * time */
+#define IGN_GROW 16    /* grow the list by 16 elements at a time */
 
 /* Nonzero if we have encountered an -I ! directive, which means one should
    no longer ask the server about what is in CVSROOTADM_IGNORE.  */
@@ -59,7 +87,9 @@
     ign_inhibit_server = 0;
 
     /* Start with default list and special case */
-    tmp = xstrdup (ign_default);
+    tmp = xstrdup (ign_dir_default);
+    ign_add (tmp, 0);
+    tmp = xstrdup (ign_file_default);
     ign_add (tmp, 0);
     free (tmp);
 

Reply via email to