App::GitHooks::Plugin::ForceRegularUpdate - Force running a specific tool at regular intervals.


# TODO: description of how to write a tool that generates the timestamp file.


Version 1.0.5


This plugin supports the following options in the [BlockProductionCommits] section of your .githooksrc file.

        max_update_age = 2 * 24 * 3600 # 2 days
        description = ./
        env_variable = my_environment
        env_safe_regex = /^development$/
        update_file = /var/local/.last_update.txt


This indicates the maximum amount of time that may have elapsed since the last update, before commits are blocked.

        max_update_age = 2 * 24 * 3600 # 2 days

Note that this configuration option supports comments at the end, for readability.


The name of the tool to run to perform an update that will reset the time counter.

        description = ./


Optional, the name of the environment variable to use to determine the environment (production, staging, development, etc).

        env_variable = my_environment


Optional, but required if env_variable is used.

A regular expression that indicates that this plugin should be run when it is matched.

        env_safe_regex = /^development$/

The example above only checks for regular updates when $ENV{'my_environment'} =~ /^development$/.


The path to the file that stores the unix time of the last upgrade. This is the file your update tool should write the current unix time to upon successful completion.

        update_file = /var/local/.last_update.txt

Note that you can use an absolute path, or a relative path. If relative, the path will be relative to the root of the current git repository.



Code to execute as part of the pre-commit hook.

  my $success = App::GitHooks::Plugin::ForceRegularUpdate->run_pre_commit();


Please report any bugs or feature requests through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

        perldoc App::GitHooks::Plugin::ForceRegularUpdate

You can also look for information at:


Guillaume Aubert, <aubertg at>.


Copyright 2013-2016 Guillaume Aubert.

This code is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file for more details.