1 Setting up git-multimail on gitolite
2 ====================================
4 ``git-multimail`` supports gitolite 3 natively.
5 The explanations below show an easy way to set up ``git-multimail``,
6 but leave ``git-multimail`` installed and unconfigured for a while. If
7 you run gitolite on a production server, it is advised that you
8 execute the step "Set up the hook" last to avoid confusing your users
14 Log in as your gitolite user.
16 Create a file ``.gitolite/hooks/common/post-receive`` on your gitolite
17 account containing (adapt the path, obviously)::
20 exec /path/to/git-multimail/git-multimail/git_multimail.py "$@"
22 Make sure it's executable (``chmod +x``). Record the hook in
30 First, you have to allow the admin to set Git configuration variables.
32 As gitolite user, edit the line containing ``GIT_CONFIG_KEYS`` in file
33 ``.gitolite.rc``, to make it look like::
35 GIT_CONFIG_KEYS => 'multimailhook\..*',
37 You can now log out and return to your normal user.
39 In the ``gitolite-admin`` clone, edit the file ``conf/gitolite.conf``
43 # Not strictly needed as git_multimail.py will chose gitolite if
45 config multimailhook.environment = gitolite
46 config multimailhook.mailingList = # Where emails should be sent
47 config multimailhook.from = # From address to use
49 Obviously, you can customize all parameters on a per-repository basis by
50 adding these ``config multimailhook.*`` lines in the section
51 corresponding to a repository or set of repositories.
53 To activate ``git-multimail`` on a per-repository basis, do not set
54 ``multimailhook.mailingList`` in the ``@all`` section and set it only
55 for repositories for which you want ``git-multimail``.
57 Alternatively, you can set up the ``From:`` field on a per-user basis
58 by adding a ``BEGIN USER EMAILS``/``END USER EMAILS`` section (see
61 Specificities of Gitolite for Configuration
62 -------------------------------------------
64 Empty configuration variables
65 .............................
67 With gitolite, the syntax ``config multimailhook.commitList = ""``
68 unsets the variable instead of setting it to an empty string (see
70 <http://gitolite.com/gitolite/git-config.html#an-important-warning-about-deleting-a-config-line>`__).
71 As a result, there is no way to set a variable to the empty string.
72 In all most places where an empty value is required, git-multimail
73 now allows to specify special ``"none"`` value (case-sensitive) to
76 Alternatively, one can use ``" "`` (a single space) instead of ``""``.
77 In most cases (in particular ``multimailhook.*List`` variables), this
78 will be equivalent to an empty string.
80 If you have a use-case where ``"none"`` is not an acceptable value and
81 you need ``" "`` or ``""`` instead, please report it as a bug to
84 Allowing Regular Expressions in Configuration
85 .............................................
87 gitolite has a mechanism to prevent unsafe configuration variable
88 values, which prevent characters like ``|`` commonly used in regular
89 expressions. If you do not need the safety feature of gitolite and
90 need to use regular expressions in your configuration (e.g. for
91 ``multimailhook.refFilter*`` variables), set
93 <http://gitolite.com/gitolite/git-config.html#unsafe-patt>`__ to a
94 less restrictive value.
99 Warning: this will disable ``git-multimail`` during the debug, and
100 could confuse your users. Don't run on a production server.
102 To debug configuration issues with ``git-multimail``, you can add the
103 ``--stdout`` option when calling ``git_multimail.py`` like this::
106 exec /path/to/git-multimail/git-multimail/git_multimail.py --stdout "$@"
108 and try pushing from a test repository. You should see the source of
109 the email that would have been sent in the output of ``git push``.