Sometimes the checks take a long time, such as when too many files are affected in a commit and they all need to be checked. Git::Hooks should accept a configuration option such that it would skip further checks after a specified amount of time.
The timeout should be detected by a signal handler which would enable a flag in the Git::Repository object, which could be checked by a method called "check_timeout()", for example.
The run_hooks function should check this method before invoking each plugin function.
Moreover, plugins such as CheckFile, which can take a long list of files to check, should also check the method before invoking external checks for each file.
I think on a timeout the hooks shouldn't return error, but simply print a warning telling that some checks were skipped due to time constraints. Or perhaps this could be an option also...
Sometimes the checks take a long time, such as when too many files are affected in a commit and they all need to be checked. Git::Hooks should accept a configuration option such that it would skip further checks after a specified amount of time.
The timeout should be detected by a signal handler which would enable a flag in the Git::Repository object, which could be checked by a method called "check_timeout()", for example.
The run_hooks function should check this method before invoking each plugin function.
Moreover, plugins such as CheckFile, which can take a long list of files to check, should also check the method before invoking external checks for each file.
I think on a timeout the hooks shouldn't return error, but simply print a warning telling that some checks were skipped due to time constraints. Or perhaps this could be an option also...