guillaumeaubert / App-GitHooks

Plugin-based system to run specific actions and checks when git hooks are triggered.
https://metacpan.org/pod/App::GitHooks
Other
6 stars 3 forks source link

Support inherited .githooksrc settings #7

Open guillaumeaubert opened 10 years ago

guillaumeaubert commented 10 years ago

App::GitHooks supports fallbacks when looking for an appropriate .githooksrc file, in order of decreasing preference:

  1. At the root of the repository.
  2. Specified by the GITHOOKSRC environment variable.
  3. In the user's home directory.

However, this fallback system doesn't currently support inheritance - in other words, if you have a .githooksrc file at the root of a repository, all the other locations are simply ignored. It would be nice to instead have an inheritance system with settings being merged while maintaining the order of preference above when merging conflicting keys.

@timbunce pointed out that Config::GitLike has the same concept of repo-specific config, user config, and global config, plus it already has the inheritance bits built-in, so it seems like a good replacement for Config::Tiny that would make this feature much easier to implement.

guillaumeaubert commented 10 years ago

The only downside is that the format of the files of Config::GitLike and Config::Tiny are not compatible, so this is a major version change.

Also, a utility would need to be provided to convert from the old format to the new one.

sjn commented 8 years ago

This is a really, really useful feature. If you somehow can make this happen, that would be great.