gitolite-admin

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 77bed59752fbe7df0b00b0fa89c08c83509f6e93
parent 4480a3241bb1880c9a06e3ab5e1e71ed3d7e273f
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun, 16 Sep 2018 14:50:42 +0300

.

Diffstat:
Alocal/find_stagits.lua | 20++++++++++++++++++++
Mlocal/hooks/repo-specific/stagit | 3++-
2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/local/find_stagits.lua b/local/find_stagits.lua @@ -0,0 +1,20 @@ +#! /usr/bin/env lua + +local gitolite = os.getenv( "GL_ADMIN_BASE" ) +local f = assert( io.open( gitolite .. "/conf/gitolite.conf" ) ) + +local cmd = { } + +local current_repo +for l in f:lines() do + local repo = l:match( "^repo (.*)" ) + if repo then + current_repo = repo + elseif l == "\toption hook.post-receive = stagit" then + table.insert( cmd, "/var/git/repositories/" .. current_repo .. ".git" ) + end +end + +f:close() + +print( table.concat( cmd, " " ) ) diff --git a/local/hooks/repo-specific/stagit b/local/hooks/repo-specific/stagit @@ -4,12 +4,13 @@ pwd env reponame="$(basename "$(pwd)" .git)" +echo "Michael Savage" > owner mkdir -p "/var/www/git/$reponame" cd "/var/www/git/$reponame" ln -sf ../style.css . stagit "/var/git/repositories/$reponame.git/" -c .htmlcache -stagit-index /var/git/repositories/medfall.git /var/git/repositories/mudgangster.git /var/git/repositories/umbra.git > /var/www/git/index.html +stagit-index $($GL_ADMIN_BASE/local/find_stagits.lua) > /var/www/git/index.html find . -type f -print0 | xargs -0 chmod 644 find . -type d -print0 | xargs -0 chmod 755