diff options
author | David A. Wheeler <dwheeler@dwheeler.com> | 2013-09-02 18:44:00 -0400 |
---|---|---|
committer | David A. Wheeler <dwheeler@dwheeler.com> | 2013-09-02 18:44:00 -0400 |
commit | 8ff6e9798f9909594ad497bc70d39a3cf3bbf2e9 (patch) | |
tree | e1ba431f7498fa77782d86c8eed124994967ca81 | |
parent | ee28e6d7c817a920b29059e8c82fc43b879d7eba (diff) | |
download | sloccount-git-8ff6e9798f9909594ad497bc70d39a3cf3bbf2e9.tar.gz |
Ignore files generated by Version Control Systems [from: a_m0d]
- Ignore files which version control software (aka
revision control software or configuration management software)
places in a working directory.
This version ignores files used by SVN, git, and Mercurial.
"This is done by simply testing whether the path name
includes a directory name used by these systems, and ignoring
the file if it does. This results in much more accurate SLOCcounts.
- See: https://sourceforge.net/p/sloccount/patches/14/
-rwxr-xr-x | break_filelist | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/break_filelist b/break_filelist index 3b10299..877051f 100755 --- a/break_filelist +++ b/break_filelist @@ -1285,6 +1285,11 @@ while ( $dir = shift ) { print STDERR "Filename is: $file\n"; next; } + if ($file =~ /.*\/(\.git|\.svn|\.hg)\/.*/) { + # File is part of the RCS software + # Don't count it, as it is generated automatically + next; + } $file_type = &get_file_type($file); if ($file_type) { &record_file_type($file, $file_type); |