File::...le::VCS(3pm)
π File::Find::Rule::VCS π
okay bestie, so this is a page from the User Contributed Perl Documentation set, filed under File::...le::VCS(3pm) (yes the title is literally truncated like that, the man page gods have a sense of humor). Buckle up, it's giving "skip the junk folders in your repo" energy and it ate.
β¨ NAME β¨
File::Find::Rule::VCS β exclude files/directories for Version Control Systems. No cap, that's the whole job.
πΈ SYNOPSIS πΈ
use File::Find::Rule ();
use File::Find::Rule::VCS ();
# Find all files smaller than 10k, ignoring version control files
my @files = File::Find::Rule->ignore_vcs
->file
->size('<10Ki')
->in( $dir );
literally copy-paste this and you're already slaying.
π¦ DESCRIPTION π¦
So like, a ton of tools need to work equally well on normal everyday files and on code that got checked out from a revision control system. Two very different vibes, same tool.
File::Find::Rule::VCS gives you quick + convenient methods to exclude the version control directories of several major Version Control Systems β currently CVS, subversion, and Bazaar.
File::Find::Rule::VCS implements methods to ignore the following:
- CVS
- Subversion
- Bazaar
And bestie, plot twist π β the following version control systems do not create directories in the checkout and therefore do not require the use of any ignore methods:
- SVK
- Git
iconic behavior tbh. nothing to ignore, nothing to do. periodt.
π METHODS π
π ignore_vcs π
# Ignore all common version control systems
$find->ignore_vcs;
# Ignore a specific named version control systems
$find->ignore_vcs($name);
# Ignore nothing (silent pass-through)
$find->ignore_vcs('');
The ignore_vcs method excludes the files for a named Version Control System from your File::Find::Rule search.
If you pass a name, the name of the version control system is case in-sensitive (yes, really, it says "in-sensitive" and we're respecting it). Names currently supported are 'cvs', 'svn', 'subversion', 'bzr', and 'bazaar'.
As a convenience for high-level APIs, if the VCS name is the defined null string '' then the call will be treated as a nullop β it just does nothing and moves on, no drama.
If no params at all are passed, this method will ignore all supported version control systems. But heads up, and this is important:
If you're ignoring every version control system, please note that any legitimate directories called"CVS"or files starting with.#will be ignored β which is not always desirable. π
In widely-distributed code, you instead should try to detect the specific version control system used and call ignore_vcs with the specific name. iykyk.
Passing "undef", or an unsupported name, will throw an exception. π no silent failures here.
π ignore_cvs π
The ignore_cvs method excluding all CVS directories from your File::Find::Rule search.
It will also exclude all the files left around by CVS after an automated merge that start with '.#' (dot-hash). those little gremlins get yeeted too.
π§ ignore_rcs π§
The ignore_rcs method excluding all RCS directories from your File::Find::Rule search.
It will also exclude all the files used by RCS to store the revisions (end with ',v'). bye bye revision files β¨
π ignore_svn π
The ignore_svn method excluding all Subversion (.svn) directories from your File::Find::Rule search.
π ignore_bzr π
The ignore_bzr method excluding all Bazaar (.bzr) directories from your File::Find::Rule search.
β ignore_git β
The ignore_git method excluding all Git (.git) directories from your File::Find::Rule search.
π«Ά ignore_hg π«Ά
The ignore_hg method excluding all Mercurial/Hg (.hg) directories from your File::Find::Rule search.
π₯ TO DO π₯
- Add support for other version control systems.
- Add other useful VCS-related methods
(the author said "coming soon" and honestly? we believe them.)
π SUPPORT π
Bugs should always be submitted via the CPAN bug tracker:
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Find-Rule-VCS>
For other issues, contact the maintainer.
πΈ AUTHOR πΈ
Adam Kennedy <adamk@cpan.org>
π SEE ALSO π
<http://ali.as/>, File::Find::Rule
π COPYRIGHT π
Copyright 2005 - 2010 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
okay that's the whole page bestie, you're fully caught up π and just so you know β this doc lives in perl v5.36.0, got dated 2023-11-01, and answers to the man-name File::...le::VCS(3pm) (yes, still truncated, iconic). mwah π go ignore some .svn folders, you've got this π¦β¨
π¦ where this page comes from
- debian trixie: libfile-find-rule-vcs-perl 1.09-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libfile-find-rule-vcs-perl 1.09-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libfile-find-rule-vcs-perl 1.09-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libfile-find-rule-vcs-perl 1.09-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms