Advertisement

Hooks, and Why They Can Be Useful

  • Chris Kemper
  • Ian Oxley

Abstract

Hooks are commands, or scripts, that are triggered by events occurring in your repository. These events occur when you commit, push, and pull. Hooks have access to environment variables, can receive arguments containing revision information, and allow you to control whether a particular repository event can proceed or gets blocked. They live in, but are not checked in to, your repository, and a given event can have a hook that fires before, during, or immediately after said event—for example, pre-commit, commit, and post-commit. In this chapter, you’ll have a look at what hooks are available in SVN, Git, and Mercurial, how you can enable hooks, and finally look at some examples of what you can do with hooks.

Keywords

Python Script Exit Status Local Repository Shell Command Path Separator 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Chris Kemper and Ian Oxley 2012

Authors and Affiliations

  • Chris Kemper
  • Ian Oxley

There are no affiliations available

Personalised recommendations