Tag Archives: rails

Hacking SCM Creator and Redmine Git Hosting to Cooperate with one another

Edit June 6, 2012: SCM Creator has been updated to not conflict with Redmine Git Hosting.

Introduction

Oftentimes it’s beneficial to use more than one type of version control system within a given organization—SVN and Git being the two most popular. For the purposes of Redmine, the Redmine Git Hosting plugin is significantly more useful for handling git repositories, as it can manage public keys and is able to serve git files via the Smart HTTP Protocol. However, for the other repository types, it is generally easier to use the SCM Creator plugin, which allows the project manager to control repository creation and deletion.

Previously, these plugins were incompatible, both overriding the same method. Moreover, SCM Creator has compatibility issues with Redmine 1.4.0+. Thanks to the work of its creator, Andriy Lesyuk, however, both of these issues have been resolved!

Assumptions

  1. SCM Creator is installed in /usr/share/redmine/vendor/plugins/scm_creator, as per my guide here
  2. Redmine Git Hosting is installed in /usr/share/redmine/vendor/plugins/redmine_git_hosting, as per my guide here
  3. You want to use SCM Creator for everything that is not Git, and Redmine Git Hosting to handle all of the Git requests on its own

Configuring SCM Creator to work with Redmine Git Hosting

The configuration change here is fairly simple:

Edit the scm.yml file and add the following lines to it:

only_creator: false
allow_add_local: true

so that the final file looks like this:

$ cat /usr/share/redmine/config/scm.yml
production:
  auto_create: false
  deny_delete: false
  pre_create: /usr/local/bin/pre-create.sh
  post_create: /usr/local/bin/post-create.sh
  pre_delete: /usr/local/bin/pre-delete.sh
  post_delete: /usr/local/bin/post-delete.sh
  svn:
    path: /var/svn
    svnadmin: /usr/bin/svnadmin
    url: svn
  only_creator: false
  allow_add_local: true

and restart Apache. Everything should work properly after that!

View old version here: Expand

Introduction

If you’ve been following along my other tutorials, you’ve probably noticed that the SCM Creator and Redmine Git Hosting plugins really just don’t want to cooperate one another. The conflict here is that they both override the same method (RepositoriesController#edit), so that while they appear to work on the surface (the correct menu shows up for each), the Git repository creation results in a 500 error message in AJAX, and the repository is not created. It turns out that, due to the internal implementations of these plugins, fixing this problem isn’t terribly hard, although it does involve editing two lines in the plugin files directly.

Read More Leave a Comment

May 5, 2012

Categories:

software

Tags:

, , , , , , ,