SVN::H...Generic(3pm)
π NAME π
SVN::Hooks::Generic β bestie, it implements generic checks for all Subversion hooks. That's the whole vibe. π
β¨ VERSION β¨
version 1.36 β yes she's got a number, she's official, she's versioned π
πΈ SYNOPSIS πΈ
Okay so real talk first: this SVN::Hooks plugin lets you easily write generic checks for all Subversion standard hooks. Cute, right? Butβ¦ it's deprecated. π« Not me being the bearer of bad news, but you should use the SVN::Hooks hook-defining exported directives instead. That's the move. Periodt.
This module gets configured by the following directive, and she's a big one:
π¦ GENERIC(HOOK => FUNCTION, HOOK => [FUNCTIONS], ...) π¦
This directive associates FUNCTION with a specific HOOK. And like, you're not limited to one β you can make more than one association with a single directive call, or you can use multiple calls to make multiple associations. Do it however feels right for you, bestie. π
Moreover (love that word), you can associate a hook with a single function or with a list of functions (passing them as elements of an array). And heads up: all functions associated with a hook will be called in an unspecified order with the same arguments. So don't go assuming a sequence, okay? π
Each hook must be associated with functions with a specific signature β i.e., the arguments that get passed to the function depend on the hook it's associated with. Signature match or it's a no from her. π
The hooks are specified by their standard names. Iconic of them honestly.
The function signatures are the following:
post-commit(SVN::Look)
post-lock(repos-path, username)
post-revprop-change(SVN::Look, username, property-name, action)
post-unlock(repos-path, username)
pre-commit(SVN::Look)
pre-lock(repos-path, path, username, comment, steal-lock-flag)
pre-revprop-change(SVN::Look, username, property-name, action)
pre-unlock(repos-path, path, username, lock-token, break-unlock-flag)
start-commit(repos-path, username, capabilities, txt-name)
The functions may perform whatever checks they want β go off, be creative, the world is yours π. If the checks succeed, the function must simply return. That's it. Just return. Slay.
Otherwise? They must die with a suitable error message. π That error message gets sent back to the user performing the Subversion action which triggered the hook. So write something nice-ish, bestie, someone's gonna read it.
The sketch below shows how this directive could be used. It's giving tutorial:
sub my_start_commit {
my ($repo_path, $username, $capabilities, $txt_name) = @_;
# ...
}
sub my_pre_commit {
my ($svnlook) = @_;
# ...
}
GENERIC(
'start-commit' => \&my_start_commit,
'pre-commit' => \&my_pre_commit,
);
See how clean that is? Obsessed. π
π AUTHOR π
Gustavo L. de M. Chaves <gnustavo@cpan.org> β the icon, the legend, the main character who wrote this. π«Ά
π 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. So like, go forth and share, fr fr. π
β Also shoutout to the header energy: this is the SVN::H...Generic(3pm) page from the User Contributed Perl Documentation β that's the manual name, and now you know it. π
And that's a wrap, bestie! π¦ This one came to you from perl v5.36.0, dated 2022-09-11, and it's the SVN::H...Generic(3pm) page. Stan a well-documented hook. Mwah. π
ππΈ
π¦ 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