find_stagits.lua (546B)
1 #! /usr/bin/env lua 2 3 local gitolite = os.getenv( "GL_ADMIN_BASE" ) 4 local f = assert( io.open( gitolite .. "/conf/gitolite.conf" ) ) 5 6 local cmd = { } 7 8 local current_repos 9 for l in f:lines() do 10 local repos = l:match( "^repo (.*)" ) 11 if repos then 12 current_repos = repos 13 elseif l == "\toption hook.post-receive = stagit" then 14 for repo in current_repos:gmatch( "%S+" ) do 15 if repo ~= "gitolite-admin" then 16 table.insert( cmd, "/var/git/repositories/" .. repo .. ".git" ) 17 end 18 end 19 end 20 end 21 22 f:close() 23 24 print( table.concat( cmd, "\n" ) )