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
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Writing your own VREF


Here's an example use case where VREFs come in handy. We'll use this to design a very simple VREF, in a way that cannot be done with the existing rules.

The requirement is simple: for any repository foo, if a repository called l10n contains a directory called foo, then you cannot push any files called *.po to foo.

Tip

This has been adapted from a more complex, real-life use case, but for our purposes we don't need more than this. As you might guess, this is a multi-repository system that is gradually moving toward centralizing the local language files so that translators only have to deal with one repository. Each repository's local language files are moved over when they are deemed ready and from that point on, localization files must go to the single repository that was created for the purpose.

Because this is a very specific use case, we can write a simple VREF that does not take any arguments. Our rule can look like this:

repo @all
-  VREF/l10n-check  =  @all

As you...