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.

ChiliProject::VERSION.revision doesn't capture error output (Bug #748)


Added by Pete Deffendol at 2011-12-02 05:49 am. Updated at 2011-12-15 09:10 pm.


Status:Closed Start date:2011-12-02
Priority:Normal Due date:
Assignee:Felix Schäfer % Done:

0%

Category:Refactoring
Target version:2.6.0
Remote issue URL: Affected version:2.5.0

Description

My production ChiliProject install is outputting an error in my Apache logs and when I run a rake task:

fatal: Not a git repository (or any of the parent directories): .git

Turns out, this is the culprit (from the Rails console):

>> ChiliProject::VERSION.revision 
fatal: Not a git repository (or any of the parent directories): .git
=> nil

And, in lib/chili_project/version.rb, starting at line 40:

    def self.revision
      revision = `git rev-parse HEAD`
      if revision.present?
        revision.strip[0..8]
      else
        nil
      end
    end

This doesn't manifest in development, because I'm working with a Git clone. But in production, I deploy to a clean folder, so there is no repository to read.

The output of the backtick command (git rev-parse HEAD) needs to be captured and thrown away.


Associated revisions

Revision 0d9e4196
Added by Jean-Philippe Lang at 2008-03-31 10:51 pm

Add overflow:auto to the content div (closes #676, #748, #961).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1314 e93f8b46-1217-0410-a6f0-8f06a7374b81

Revision d943efd0
Added by Felix Schäfer at 2011-12-03 05:39 pm

[#748] Make ChiliProject::Version.revision more resilient

  • Won't output errors when the ChiliProject git repo isn't there anymore,
  • Works even if not invoked from the ChiliProject root directory,
  • Moved the formatting logic to the git call.

Revision 611889f3
Added by Holger Just at 2011-12-15 10:08 pm

[#748] Use SCM commands to detect the revision

History

Updated by Pete Deffendol at 2011-12-02 06:08 am

Using this works, but only on a Linux-type system:

`git rev-parse HEAD 2>/dev/null`

Updated by Felix Schäfer at 2011-12-02 06:10 am

Thanks for the report. Did you use one of the packaged versions or did you "export" it from the git repository yourself?

  • Target version set to 2.6.0

Updated by Pete Deffendol at 2011-12-02 06:18 am

Felix Schäfer wrote:

Thanks for the report. Did you use one of the packaged versions or did you "export" it from the git repository yourself?

I'm exporting from a local clone of the official repository. It's 2.5.0 with a few of our own modifications.

Updated by Felix Schäfer at 2011-12-03 04:41 pm

I've corrected this issue and made the code more resilient in d943efd, thanks for reporting!

  • Assignee set to Felix Schäfer
  • Category set to Refactoring
  • Status changed from Open to Closed

Updated by Holger Just at 2011-12-15 09:10 pm

I just updated your patch and made it use the git repository adapter. That way, we don't duplicate code and people can set the path to the git binary.

Commit in 611889f

Also available in: Atom PDF