Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 71fe17dc61
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (31 sloc) 1.714 kb

When using gitorious, it installs it own hooks into each git repository. So you can't install the post-receive hook of Trac's Git Plugin. However gitorious provides WebHooks. That is the ability to configure a URL that is called when a certain repository was pushed. So you can use this CGI script as WebHook for Trac's Git Plugin.


Copy the CGI script into the cgi-bin directory of your trac environment and open the CGI script with your favorite editor in order to change the constants BRANCHES, TRAC_ENV and REPO_NAME, respective your setup:

cp trac-web-hook.cgi <tracenv>/deploy/cgi-bin/
vim <tracenv>/deploy/cgi-bin/trac-web-hook.cgi

Now you have to configure the CGI script in your web server. Therfore setup a new virtual host, that is only local reachable. If you don't have Trac and Gitorious running on the same machine you have to use an IP address reachable from the server running Gitorious. But make sure that the port isn't reachable from the internet, because no authentification is required to call the script:


    ScriptAlias / <tracenv>/deploy/cgi-bin/trac-web-hook.cgi

Finally tell Gitorious to use the URL you have just configured, as WebHook for your repository:

project = Project.find_by_slug "<project>"
repository = project.repositories.find_by_name "<repo>"
hook =
hook.user = repository.user
hook.url = "http://localhost:8000/"
Jump to Line
Something went wrong with that request. Please try again.