ChiliProject is not maintained anymore.
Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and
we urge all existing users to migrate their data to a maintained
system, e.g. Redmine. We will
provide a migration script later. In the meantime, you can use the
instructions by
Christian Daehn.
Forums » Discuss »
fatal: Not a git repository when running rake tasks
Added by Pete Deffendol at 2011-12-02 05:22 am
When I run my rake tasks in production, I'm getting an error notice. The task seems to run, but I can't seem to find out why it's even looking for a git repository. I don't have any associated with my projects being tracked - they're all SVN repos.
I'm using:
ChiliProject 2.5.0 (just upgraded from 1.5)
Ruby Enterprise Edition 1.8.7
Here's what it looks like:
$ bundle exec rake redmine:fetch_changesets RAILS_ENV=production --trace
** Invoke redmine:fetch_changesets (first_time)
** Invoke environment (first_time)
** Execute environment
fatal: Not a git repository (or any of the parent directories): .git
** Execute redmine:fetch_changesets
Any ideas on how to pinpoint the source of this problem?
An update - I found out where it's happening:
lib/chili_project/version.rb, line 40:
def self.revision
revision = `git rev-parse HEAD`
if revision.present?
revision.strip[0..8]
else
nil
end
end
In production, I have no Git repository clone. This should definitely be modified to avoid any error output. It's especially annoying in my cron tasks, as every single one outputs the same error notice to my inbox.
I'll make a ticket.
Good catch, thanks for reporting :-)