2012-03-16 02:54:47 +01:00
|
|
|
# customising gitolite
|
|
|
|
|
2012-03-26 08:23:00 +02:00
|
|
|
Much of gitolite (g3)'s functionality comes from programs and scripts that are
|
|
|
|
not considered "core". This keeps the core simpler, and allows you to enhance
|
2012-04-05 18:01:23 +02:00
|
|
|
gitolite for your own purposes without too much fuss. (As an extreme example,
|
|
|
|
even mirroring is not in core now!)
|
|
|
|
|
|
|
|
(Also, please see the [developer notes][dev-notes] page).
|
2012-03-16 02:54:47 +01:00
|
|
|
|
2012-03-26 08:23:00 +02:00
|
|
|
## types of non-core programs
|
2012-03-16 02:54:47 +01:00
|
|
|
|
2012-03-26 08:23:00 +02:00
|
|
|
There are 5 basic types of non-core programs.
|
2012-03-16 02:54:47 +01:00
|
|
|
|
2012-04-05 18:01:23 +02:00
|
|
|
* *commands* can be run from the shell command line. Among those, the ones
|
|
|
|
listed in the COMMANDS hash of the rc file can also be run remotely.
|
2012-03-26 08:23:00 +02:00
|
|
|
* *hooks* are standard git hooks; see below.
|
|
|
|
* *sugar scripts* change the conf language for your convenience. The word
|
2012-04-05 18:01:23 +02:00
|
|
|
sugar comes from "syntactic sugar".
|
2012-03-26 08:23:00 +02:00
|
|
|
* *triggers* are to gitolite what hooks are to git. I just chose a
|
|
|
|
different name to avoid confusion and constant disambiguation in the docs.
|
|
|
|
* **VREFs** are extensions to the access control check part of gitolite.
|
2012-03-16 02:54:47 +01:00
|
|
|
|
2012-03-26 18:00:12 +02:00
|
|
|
[Here][non-core] is a list of non-core programs shipped with gitolite, with
|
|
|
|
some description of each.
|
|
|
|
|
2012-03-26 08:23:00 +02:00
|
|
|
## #commands gitolite "commands"
|
2012-03-16 02:54:47 +01:00
|
|
|
|
2012-04-05 18:01:23 +02:00
|
|
|
Gitolite comes with several commands that users can run. Remote users run the
|
2012-03-26 08:23:00 +02:00
|
|
|
commands by saying:
|
2012-03-16 02:54:47 +01:00
|
|
|
|
2012-03-26 08:23:00 +02:00
|
|
|
ssh git@host command-name [args...]
|
2012-03-16 02:54:47 +01:00
|
|
|
|
2012-03-26 08:23:00 +02:00
|
|
|
while on the server you can run
|
2012-03-16 02:54:47 +01:00
|
|
|
|
2012-03-26 08:23:00 +02:00
|
|
|
gitolite command [args...]
|
2012-03-16 02:54:47 +01:00
|
|
|
|
2012-03-26 08:23:00 +02:00
|
|
|
Very few commands are designed to be run both ways, but it can be done, by
|
|
|
|
checking for the presence of env var `GL_USER`.
|
|
|
|
|
|
|
|
You can get a **list of available commands** by using the `help` command.
|
|
|
|
Naturally, a remote user will see a much smaller list than the server user.
|
|
|
|
|
|
|
|
You add commands to the "allowed from remote" list by adding its name (or
|
|
|
|
uncommenting it if it's already added but commented out) to the COMMANDS hash
|
|
|
|
in the [rc][] file.
|
|
|
|
|
|
|
|
If you write your own commands, put them in src/commands.
|
|
|
|
|
|
|
|
## #hooks hooks and gitolite
|
|
|
|
|
|
|
|
Gitolite uses the `update` hook for all repos. In addition, it uses the
|
|
|
|
`post-update` hook for the gitolite-admin repo.
|
|
|
|
|
|
|
|
If you want to add your own hook, it's easy as long as it's not the 'update'
|
|
|
|
hook. Just add it to `$HOME/.gitolite/hooks/common` and run `gitolite setup`.
|
|
|
|
|
|
|
|
The rest is between you and 'man githooks' :-)
|
|
|
|
|
|
|
|
## #sugar syntactic sugar
|
|
|
|
|
|
|
|
Sugar scripts help you change the perceived syntax of the conf language. The
|
2012-04-05 18:01:23 +02:00
|
|
|
base syntax of the language is very simple, so sugar scripts take something
|
|
|
|
*else* and convert it into that.
|
2012-03-26 08:23:00 +02:00
|
|
|
|
|
|
|
That way, the admin sees additional features (like allowing continuation
|
|
|
|
lines), while the parser in the core gitolite engine does not change.
|
|
|
|
|
|
|
|
If you want to write your own sugar scripts, please read the "your own sugar"
|
|
|
|
section in [dev-notes][] first then email me.
|
|
|
|
|
|
|
|
## triggers
|
|
|
|
|
|
|
|
Triggers have their own [document][triggers].
|
|
|
|
|
|
|
|
## VREFs
|
|
|
|
|
|
|
|
VREFs also have their own [document][vref].
|