This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cvsignore


"Greg J. Badros" <gjb@cs.washington.edu> writes:

> > Why?  I think that .cvsignore is a property of the module to which it
> > belongs.  The module owner (the FSF in this case) can specify the list
> > of files which are to be ignored in the current module.  This list is
> > valid for every environment in which the module may be used.
> 
> Right, and that is my belief, too, but there was concern about
> developers who believed that .cvsignore should be reserved for the user
> to specify his/her preferences.

I'm one of those and I still don't think .cvsignore should be in the
repo.  But I guess it's hard to come to a conclusion as peoples
experiences with CVS, their expectations how they want it to work, etc
vary widly.  So I hacked CVS to support the idea of having it both
ways.

Everybody who wants to have his personal .cvsignore file can use the
hacked CVS (patch below) and .cvsignore just stays in the repository.

The patch works like this: when the environment variable CVSDOTIGNORE
is set, it specifies the file name of the per-directory .cvsignore
file.  When that file exists, CVS uses it instead of the usual
".cvsignore".  When the file does not exist, it tries ".cvsignore"
instead.  Not that CVS does only use one per-directory file.

That way, I can add CVSDOTIGNORE=.cvsignore-personal to my environment
and ignore the checked in ".cvsignore" files.

A discussion of this issue and the patch should probably be added to
HACKING if people agree that this is workable solution.

- Marius

Only in cvs-1.10/doc: cvs.aux
Only in cvs-1.10/doc: cvsclient.aux
diff -r -u cvs-1.10/src/cvs.h cvs-1.10.ignore-hack/src/cvs.h
--- cvs-1.10/src/cvs.h	Mon Jul 27 04:54:11 1998
+++ cvs-1.10.ignore-hack/src/cvs.h	Sun Jan 23 12:58:09 2000
@@ -516,7 +516,7 @@
 
 extern int ign_name PROTO ((char *name));
 void ign_add PROTO((char *ign, int hold));
-void ign_add_file PROTO((char *file, int hold));
+int ign_add_file PROTO((char *file, int hold));
 void ign_setup PROTO((void));
 void ign_dir_add PROTO((char *name));
 int ignore_directory PROTO((char *name));
Only in cvs-1.10.ignore-hack/src: cvs.h~
diff -r -u cvs-1.10/src/ignore.c cvs-1.10.ignore-hack/src/ignore.c
--- cvs-1.10/src/ignore.c	Mon Sep  8 01:04:15 1997
+++ cvs-1.10.ignore-hack/src/ignore.c	Sun Jan 23 12:57:50 2000
@@ -99,9 +99,9 @@
 /*
  * Open a file and read lines, feeding each line to a line parser. Arrange
  * for keeping a temporary list of wildcards at the end, if the "hold"
- * argument is set.
+ * argument is set.  Return true when the file exists and has been handled.
  */
-void
+int
 ign_add_file (file, hold)
     char *file;
     int hold;
@@ -149,8 +149,8 @@
     if (fp == NULL)
     {
 	if (! existence_error (errno))
-	    error (0, errno, "cannot open %s", file);
-	return;
+	  error (0, errno, "cannot open %s", file);
+	return 0;
     }
     while (getline (&line, &line_allocated, fp) >= 0)
 	ign_add (line, hold);
@@ -159,6 +159,7 @@
     if (fclose (fp) < 0)
 	error (0, errno, "cannot close %s", file);
     free (line);
+    return 1;
 }
 
 /* Parse a line of space-separated wildcards and add them to the list. */
@@ -375,6 +376,7 @@
     struct stat sb;
     char *file;
     char *xdir;
+    char *cvsdotignore;
 
     /* Set SUBDIRS if we have subdirectory information in ENTRIES.  */
     if (entries == NULL)
@@ -397,7 +399,10 @@
     if (dirp == NULL)
 	return;
 
-    ign_add_file (CVSDOTIGNORE, 1);
+    cvsdotignore = getenv("CVSDOTIGNORE");
+    if (cvsdotignore == NULL || !ign_add_file (cvsdotignore, 1))
+      ign_add_file (CVSDOTIGNORE, 1);
+
     wrap_add_file (CVSDOTWRAPPER, 1);
 
     while ((dp = readdir (dirp)) != NULL)
Only in cvs-1.10.ignore-hack/src: ignore.c~
Only in cvs-1.10.ignore-hack/windows-NT/SCC: Makefile

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]