SVN::H...lenames(3pm)
π SVN::Hooks::DenyFilenames β the "Deny some file names" page, but make it cute
okay bestie so this is SVN::Hooks::DenyFilenames(3pm), straight out of the User Contributed Perl Documentation corner of the world, and yes it's a Perl module manual page, but we're gonna make it fun. π
β¨ NAME β¨
SVN::Hooks::DenyFilenames β Deny some file names. that's it, that's the whole vibe. it says no to certain filenames and it means it. π
πΈ VERSION πΈ
version 1.36 β yeah, this is the one you're looking at. β¨
π¦ SYNOPSIS π¦
So this SVN::Hooks plugin is the girl who stands at the door and goes "absolutely not" to certain file names getting added to your repo. no cap, it will shut that down. π«
It's active in the "pre-commit" hook, meaning it does its little vibe check before the commit even lands. iconic behaviour tbh. π
And how do you boss it around? With the following directives. let's get into it. π
π DENY_FILENAMES(REGEXP, [REGEXP => MESSAGE], ...)
This directive denies the addition of new files matching the Regexps passed as arguments. π If any file or directory added in the commit matches one of the specified Regexps, the commit is aborted with an error message that snitches on every single denied file β not just the first one. it's giving tattletale, and honestly? we love a thorough queen. π
The arguments can be either:
- compiled Regexps, or
- two-element arrays made of a compiled Regexp plus a specific error message.
If a file matches one of the lone Regexps, you get an error message like this:
DENY_FILENAMES: filename not allowed: filename
If a file matches a Regexp that's associated with an error message, then your custom message gets substituted in for that 'filename not allowed' default. customise your rejection, bestie. π
lowkey important: this directive specifies a default restriction. if there are any DENY_FILENAMES_PER_PATH directives (peep the next section π) in play, then this one is only used for files that don't match any of the specific rules over there. it's the backup plan. the understudy. the second-choice bestie. π«Ά
Example:
DENY_FILENAMES(
qr/\.(doc|xls|ppt)$/i, # ODF only, please
[qr/\.(exe|zip|jar)/i => 'No binaries, please!'],
);
π DENY_FILENAMES_PER_PATH(REGEXP => REGEXP, REGEXP => [REGEXP => MESSAGE], ...)
okay so this directive is the more specific, more main-character version of DENY_FILENAMES, because it lets you set different restrictions in different regions of the repository tree. different rules for different neighbourhoods. very much zoned, very much curated. π§
Its arguments are a sequence of rules, and each one is a pair. let's break it down:
- The first element of each pair is a regular expression specifying where in the repository this rule applies. It applies if any file being added matches the regexp. π
- The second element specifies the restrictions that should be imposed β just like the arguments to
DENY_FILENAMES.
The first rule matching an added file is used to check it. The following rules aren't tried. first match wins, no second chances, no re-dos. periodt. π
And only if no rules match a particular file will the restrictions defined by DENY_FILENAMES be imposed. that's the fallback, bestie. the safety net. β¨
Example:
DENY_FILENAMES_PER_PATH(
qr:/src/: => [qr/[^\w.-]/ => 'source files must be strict'],
qr:/doc/: => qr/[^\w\s.-]/i, # document files allow spaces too.
qr:/notes/: => qr/^$/, # notes directory allows anything.
);
look at those comments, they're literally telling you the whole story. notes directory allows anything β the notes folder is the chill friend fr fr. π
π AUTHOR π
Gustavo L. de M. Chaves <gnustavo@cpan.org> β thank you for your service, king. π«Ά
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2022 by CPqD <www.cpqd.com.br>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free software, slay. β
and that's the whole page, bestie!! πΈ this was SVN::Hooks::DenyFilenames, version 1.36, generated for perl v5.36.0 on 2022-09-11, part of the User Contributed Perl Documentation. mwah, take care of your file names, xoxo ππ¦π
π¦ where this page comes from
- ubuntu noble: libsvn-hooks-perl 1.36-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsvn-hooks-perl 1.36-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsvn-hooks-perl 1.36-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