From b851011ce5bf2c06ad2559c292ffead2059a788b Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Mon, 4 Oct 2010 14:28:58 +0530 Subject: [PATCH] new RC file variable $GL_SITE_INFO to show site-specific info --- conf/example.gitolite.rc | 13 +++++++++++++ src/gitolite.pm | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/conf/example.gitolite.rc b/conf/example.gitolite.rc index db88dbd..e189595 100644 --- a/conf/example.gitolite.rc +++ b/conf/example.gitolite.rc @@ -260,6 +260,19 @@ $GL_WILDREPOS = 0; # $GL_ADC_PATH = ""; +# -------------------------------------- +# SITE-SPECIFIC INFORMATION + +# Some installations would like to give their users customised information +# (like a link to their own websites, for example) so that each end user does +# not have to grok all the gitolite documentation. + +# If this variable is defined, the "info" command will print it at the end of +# the listing. + +# $GL_SITE_INFO = ""; +# $GL_SITE_INFO = "XYZ.COM DEVELOPERS: PLEASE SEE http://xyz.com/gitolite/help first"; + # -------------------------------------- # per perl rules, this should be the last line in such a file: 1; diff --git a/src/gitolite.pm b/src/gitolite.pm index 9733cf8..23f7fe5 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -38,7 +38,7 @@ our $USERNAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@+-]*$); # very simple patter our $REPOPATT_PATT=qr(^\@?[0-9a-zA-Z[][\\^.$|()[\]*+?{}0-9a-zA-Z._\@/-]*$); # these come from the RC file -our ($REPO_UMASK, $GL_WILDREPOS, $GL_PACKAGE_CONF, $GL_PACKAGE_HOOKS, $REPO_BASE, $GL_CONF_COMPILED, $GL_BIG_CONFIG, $GL_PERFLOGT, $PROJECTS_LIST, $GL_ALL_INCLUDES_SPECIAL); +our ($REPO_UMASK, $GL_WILDREPOS, $GL_PACKAGE_CONF, $GL_PACKAGE_HOOKS, $REPO_BASE, $GL_CONF_COMPILED, $GL_BIG_CONFIG, $GL_PERFLOGT, $PROJECTS_LIST, $GL_ALL_INCLUDES_SPECIAL, $GL_SITE_INFO); our %repos; our %groups; our %repo_config; @@ -622,6 +622,7 @@ sub report_basic print "$perm\t$r\r\n" if $perm =~ /\S/; } print "only 20 out of $count candidate repos examined\r\nplease use a partial reponame or regex pattern to limit output\r\n" if $GL_BIG_CONFIG and $count > 20; + print "$GL_SITE_INFO\n" if $GL_SITE_INFO; } # ---------------------------------------------------------------------------- @@ -656,6 +657,7 @@ sub expand_wild print "$perm\t$creator\t$actual_repo\n"; } print "only 20 out of $count candidate repos examined\nplease use a partial reponame or regex pattern to limit output\n" if $GL_BIG_CONFIG and $count > 20; + print "$GL_SITE_INFO\n" if $GL_SITE_INFO; } # there will be multiple calls to repo_rights; better to use a closure. We