Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support a versioned git-hooks.config file #54

Open
gnustavo opened this issue May 3, 2018 · 0 comments
Open

Support a versioned git-hooks.config file #54

gnustavo opened this issue May 3, 2018 · 0 comments

Comments

@gnustavo
Copy link
Owner

gnustavo commented May 3, 2018

Normally, only the Git server administrator can edit the configuration files needed to configure Git::Hooks for server hooks, because the files reside in the server.

It would be nice if the configuration could be extended by a file versioned in the repository. For example, a file called git-hooks.config at the repository root. The fact that the file can be different in different branches is a plus.

The idea is that the configuration in this file should take precedence over the configuration taken from the standard Git repository configuration files.

However, not every configuration option should be settable in this file. There are dangerous global options, such as the githooks.plugin, the githooks.disable, and the githooks.admin. There are also some dangerous plugin options, such as the githooks.checkfile.name and the githooks.checkcommit.check-code.

But there are several options that are harmless, such as githooks.checkfile.deny-token, githooks.checkcommit.push-limit, and githooks.checklog.title-period. Even the githooks.checkref.acl and the githooks.checkfile.acl options are safe in the sense that they can't cause damage. One can even use the githooks.checkfile.acl option to restrict who can commit changes to the git-hooks.config file in the repository.

I think we need a new method called, perhaps, get_config_harmless(), which should be used to grok harmless options. The dangerous ones should continue to be grokked with the git_config() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant