|
What we're listening to:
|
redmine and gitJanuary 15th, 2009Over the last few months, I’ve become a big fan of Redmine. It’s just what I was looking for when I was tired of setting up a TRAC for each project but missed the source code integration when we were using Basecamp. Redmine doesn’t look very pretty at first, but there’s some good themes (we use the basecamp inspired theme) that make it much better. When we started using git, it brought some new issues up with our workflow and redmine, and we’re not the only ones . Some people are just changing and making the repository on their redmine server their “central” repository, but our redmine is hosted locally, and our repositories for each project are hosted on the deployment machine. This causes some problems because the redmine repo doesn’t receive updates. There’s a plugin aimed at solving this, but it’s not functional yet. We solved it with a quick hack to run a git pull before redmine brings in new information from the repository:
Index: app/models/repository/git.rb
===================================================================
--- app/models/repository/git.rb (revision 2251)
+++ app/models/repository/git.rb (working copy)
@@ -36,6 +36,7 @@
end
def fetch_changesets
+ scm.fetch
scm_info = scm.info
if scm_info
# latest revision found in database
Index: lib/redmine/scm/adapters/git_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/git_adapter.rb (revision 2251)
+++ lib/redmine/scm/adapters/git_adapter.rb (working copy)
@@ -24,6 +24,11 @@
# Git executable name
GIT_BIN = "git"
+
+ def fetch
+ cmd="#{GIT_BIN} --git-dir #{target('')} --bare fetch"
+ shellout(cmd)
+ end
# Get the revision of a particuliar file
def get_rev (rev,path)
Simple, but functional. Give us a shout if this helps you or if you have a better solution.
|