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

Setup script for the git hooks in .git/hooks/ #3

Closed
guillaumeaubert opened this issue Jun 14, 2014 · 1 comment
Closed

Setup script for the git hooks in .git/hooks/ #3

guillaumeaubert opened this issue Jun 14, 2014 · 1 comment
Assignees
Milestone

Comments

@guillaumeaubert
Copy link
Owner

Setting the hooks involves:

  • creating all the hooks files;
  • making sure the Perl interpreter points to the right location;
  • making the hooks executable.

It's easy to miss a step or incorrectly perform a step, so it would be nice to have a githooks command with the following interface:

  • githooks --install or githooks -i: set up the git hooks required for App::GitHooks to work in the current repository.
  • githooks --uninstall or githooks -u: remove the git hooks previously set up. This should be done safely, i.e. with a verification that we're not removing a non-App::GitHooks hook.
  • githooks --version or githooks -v: print the current version of App::GitHooks.
  • githooks --list or githooks -l: list all the plugins currently installed in the system. It would be nice to have a list that distinguishes between the active and inactive plugins, in case there is a .githooksrc file that restricts what plugin should be run.
  • githooks without arguments: print the usage information.

Thanks to @jacobmaurer - one of our conversations about App::GitHooks triggered this idea.

@guillaumeaubert
Copy link
Owner Author

Implemented, except for githooks list which is a nice to have but will require some refactoring of App::GitHooks->get_plugins to make some of the internals of that subroutine publicly accessible. I've opened GH-8 to follow up on that feature.

Another implementation note: I went for the perlbrew/git style of having a command as first argument, i.e. githooks install instead of githooks --install. Further arguments are supported via the standard --, just like perlbrew/git do.

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