From 64979c18ea2758f87960965bf325d310ba1611cf Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Wed, 9 Dec 2009 12:16:22 +0530 Subject: [PATCH] document repo config support --- conf/example.conf | 23 +++++++++++++++++++++++ doc/2-admin.mkd | 23 +++++++++++++++++++++++ doc/3-faq-tips-etc.mkd | 7 +++++++ 3 files changed, 53 insertions(+) diff --git a/conf/example.conf b/conf/example.conf index 76db973..84ccff2 100644 --- a/conf/example.conf +++ b/conf/example.conf @@ -181,3 +181,26 @@ repo linux perl # give gitweb access as described above if you're specifying a description gitolite "Sitaram Chamarty" = "fast, secure, access control for git in a corporate environment" + +# REPO SPECIFIC GITCONFIG +# ----------------------- + +# (Thanks to teemu dot matilainen at iki dot fi) + +# this should be specified within a "repo" stanza + +# syntax: +# config sectionname.keyname = [optional value_string] + +# example usage: if you placed a hook in src/hooks that requires configuration +# information that is specific to each repo, you could do this: + +repo gitolite + config hooks.mailinglist = gitolite-commits@example.tld + config hooks.emailprefix = "[gitolite] " + config foo.bar = "" + config foo.baz = + +# This does either a plain "git config section.key value" (for the first 3 +# examples above) or "git config --unset-all section.key" (for the last +# example). Other forms (--add, the value_regex, etc) are not supported. diff --git a/doc/2-admin.mkd b/doc/2-admin.mkd index d0460ec..a93df4b 100644 --- a/doc/2-admin.mkd +++ b/doc/2-admin.mkd @@ -9,6 +9,7 @@ In this document: * adding users and repos * specifying gitweb and daemon access * custom hooks + * custom git config ### administer @@ -90,3 +91,25 @@ just run easy install once again; it'll do it to existing repos also. implements all the branch-level permissions in gitolite. If you fiddle with the hooks directory, please make sure you do not mess with this file accidentally, or all your fancy per-branch permissions will stop working.** + +#### custom git config + +The custom hooks feature is a blunt instrument -- all repos get the hook you +specified and will run it. In order to make it a little more fine-grained, +you could set your hooks to only work if a certain "gitconfig" variable was +set. Which means we now need a way to specify "git config" settings on a per +repository basis. + +Thanks to Teemu (teemu dot matilainen at iki dot fi), gitolite now does this +very easily. For security reasons, this can only be done from the master +config file (i.e., if you're using delegation, the delegated admins cannot +specify git config settings). + +Please see `conf/example.conf` for syntax. Note that this only supports the +basic forms of the "git config" command: + + git config section.key value # value may be an empty string + git config --unset-all section.key + +It does not (currently) support other options like `--add`, the `value_regex`, +etc. diff --git a/doc/3-faq-tips-etc.mkd b/doc/3-faq-tips-etc.mkd index 9a1d413..b824dec 100644 --- a/doc/3-faq-tips-etc.mkd +++ b/doc/3-faq-tips-etc.mkd @@ -19,6 +19,7 @@ In this document: * what repos do I have access to? * "exclude" (or "deny") rules * "personal" branches + * custom hooks and custom git config * design choices * keeping the parser and the access control separate @@ -530,6 +531,12 @@ first check: Just don't *show* the user this config file; it might sound insulting :-) +#### custom hooks and custom git config + +You can specify hooks that you want to propagate to all repos, as well as +per-repo "gitconfig" settings. Please see `doc/2-admin.mkd` and +`conf/example.conf` for details. + ### design choices #### keeping the parser and the access control separate