]> thyrsus.com Git - comparator.git/commitdiff
Update to exclude git/hg/bzr repo directories.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 24 Nov 2012 20:23:07 +0000 (15:23 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 24 Nov 2012 20:23:07 +0000 (15:23 -0500)
NEWS
README
shredtree.c
shredtree.py

diff --git a/NEWS b/NEWS
index 40fca37dda6ba4c99279fa6904c0c0ebc7a6c469..09a0cfa0bdb95fc40b3a3f0e673d4304a30d100b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+2.9: 2012-11-24
+  Exclude .git/.bzr/.hg repo directories as well as .svn.
+
 2.8: 2005-10-19
   Change license to BSD. Tweak Python to use hashlib rather than
   the deprecated md5 module.  Suppress some compiler warnings.
diff --git a/README b/README
index 68ce747f2a4761903dfb60415e9681c8be851919..e48b470a764d4e56f6da977a4aa2027ba000ecb2 100644 (file)
--- a/README
+++ b/README
@@ -21,6 +21,6 @@ srcdupchk - the shred algorithm in C++
 ctcompare - C Token Comparator
        http://minnie.tuhs.org/Programs/Ctcompare/
 
-See the xhangelog in the RPM spec file for recent developments.
+See the NEWS file for recent developments.
 
 
index b0e940219e7dcf0a557e0b07f71755ef29faf361..bb3edd8c422648003c4cb7f479bf3e62e137c1fd 100644 (file)
@@ -42,10 +42,10 @@ static int file_count;
 static int eligible(const char *file)
 /* is the specified file eligible to be compared? */ 
 {
-    if (strstr(file, "CVS") || strstr(file,"RCS") || strstr(file,"SCCS") || strstr(file, "SVN") || strstr(file, ".svn"))
+#define endswith(suff) !strcmp(suff, file + strlen(file) - strlen(suff))
+    if (strstr(file, "CVS") || strstr(file,"RCS") || strstr(file,"SCCS") || strstr(file, "SVN") || endswith(".svn") || endswith(".git") || endswith(".hg") || endswith(".bzr"))
        return(0);
     /* fast check for the most common suffixes */
-#define endswith(suff) !strcmp(suff, file + strlen(file) - strlen(suff))
     else if (endswith(".c") || endswith(".h") || endswith(".html"))
        return(1);
     else if (endswith(".o") || endswith("~") || endswith(".bdf"))
index a8aaaf889c10ab24460a1b57f189c3fbb03e41bc..9ce32d6a33851c8bfd869a5695e2967e87e16a8f 100755 (executable)
@@ -14,7 +14,9 @@ def eligible(file):
         return False
     elif filter(lambda x: file.endswith(x), ('.o','~', '.bdf')):
         return False
-    elif filter(lambda x: file.find(x)>-1, ('RCS','SCCS','CVS','SVN','.svn')):
+    elif filter(lambda x: file.find(x)>-1, ('RCS','SCCS','CVS','SVN')):
+        return False
+    elif filter(lambda x: file.endswith(x), ('.svn','.git','.hg','.bzr')):
         return False
     elif c_only:
         return filter(lambda x: file.endswith(x), ('.c','.cc','.h','.html'))