File::...le::VCS(3pm)

πŸ“¦
version 1.09 Β· 5 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 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