Besides the production C code, the distribution also includes
working Python versions. These were used to prototype the concept.
-If yiou want to write a new normalizer, see normalizer.c
+If you want to write a new normalizer, see linebyline.c for an example
+of how it's done.
The document scf-standard.xml describes file interchange formata
for programs that wish to interoperate with comparator.
Name: comparator
Summary: fast comparison of large source-code trees
-Version: 2.5
+Version: 2.6
Release: 1
License: GPL
Group: Utilities
%{_libdir}/python*/site-packages/comparator.py
%changelog
+* Mon Sep 20 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.6-1
+- Ignore .svn files and and SVN subdirectories. Typo fixes on manual page.
+
* Sat Aug 7 2004 Eric S. Raymond <esr@snark.thyrsus.com> - 2.5-1
- Alan Burlinson's tweaks to ease porting to SunOS. Emil Sit's
dramatic speedup for SCF-file reads. Fix incorrect statistics
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"))
+ if (strstr(file, "CVS") || strstr(file,"RCS") || strstr(file,"SCCS") || strstr(file, "SVN") || strstr(file, ".svn"))
return(0);
/* fast check for the most common suffixes */
#define endswith(suff) !strcmp(suff, file + strlen(file) - strlen(suff))
/* deduce what filtering type we should use */
#define endswith(suff) !strcmp(suff,file->name+strlen(file->name)-strlen(suff))
linebyline.mode(0);
- if (endswith(".c") || endswith(".h"))
+ if (endswith(".c") || endswith(".cc") || endswith(".h"))
linebyline.mode(C_CODE);
else if (endswith(".sh"))
linebyline.mode(SHELL_CODE);
st_atime, st_mtime, st_ctime) = os.stat(file)
if st_size <= 0:
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')):
+ return False
elif c_only:
- return filter(lambda x: file.endswith(x), ('.c','h','.txt'))
+ return filter(lambda x: file.endswith(x), ('.c','.cc','.h','.html'))
else:
return True