Book Image

Gitolite Essentials

By : Sitaram Chamarty
Book Image

Gitolite Essentials

By: Sitaram Chamarty

Overview of this book

Table of Contents (19 chapters)
Gitolite Essentials
About the Author
About the Reviewers

Writing your own non-core code

It's reasonably easy to write your own code to add features that are specific to your site. For example, suppose we want an e-mail to be sent to the administrator every time a developer creates a wild repository. We will assume that the standard Unix utilities exist and are available. In particular, we will assume the Unix mail command is available. This command takes the message from standard input, and the subject and recipient data from command-line arguments, and sends the e-mail, thus suits our purposes very well.

Since this is an action that needs to run when a repository is created, it needs to be added to the POST_CREATE trigger list. According to the Gitolite documentation, when a wild repository is created, each program in the POST_CREATE trigger list is called with the second argument being the name of the repository that was just created, while the third argument is the name of the user who created it. (If this is empty, this is not a wild repository...