ericpaulbishop / redmine_git_hosting

A ChiliProject/Redmine plugin which makes configuring your own git hosting easy.
185 stars 37 forks source link

"post-receive" is alreay present but it's not ours! #148

Closed three18ti closed 12 years ago

three18ti commented 12 years ago

When navigating to the plugin page under settings, I recieve a notification that:

"post-receive" is alreay present but it's not ours!

I also get the following debug output in my ChiliProject Logs

Processing SettingsController#plugin (for 8.8.8.8 at 2012-02-07 13:26:35) [GET]
Parameters: {"controller"=>"settings", "id"=>"redmine_git_hosting", "action"=>"plugin"}
Rendering template within layouts/admin
Rendering settings/plugin
Creating MD5 digests for Redmine Git Hosting hook
Digest for post-receive.redmine_gitolite.rb: 08e9cf99fa6285331ccdcef8b9a0d3
"post-receive" is alreay present but it's not ours!
Testing if git user("git") can sudo to web user("www-data")
Testing if web user("www-data") can sudo to git user("git")
Completed in 426ms (View: 421, DB: 1) | 200 OK [http://chiliproject/settings/plugin/redmine_git_hosting]

However, when pushing to the server, this hook appears to execute:

Processing GitoliteHooksController#post_receive (for 8.8.8.8 at 2012-02-07 13:26:09) [POST]
  Parameters: {"refs"=>  
["1860befd529a23f205e36c19bd6da4d1a0629ebb,003766acfe268bc63caeef2638d96e0c1d6e30,refs/heads/master"], 
"debug"=>"true", "asynch"=>"true", "controller"=>"gitolite_hooks", "url"=>"http://chiliproject/githooks/post-receive", 
"clear_time"=>"1328646369", "encoded_time"=>"051e91e2c2151d8037bfef786104cc446a3d1944", 
"action"=>"post_receive", "projectid"=>"testing"}

Completed in 38ms (View: 0, DB: 20) | 200 OK [http://chiliproject/githooks/post-receive]

First of all, who is "ours" (Could be git, www-data, chiliprojet; I have tried all three to no avail)?

Second, what does this hook do, and how can I prove it is actually executing?

Thanks, Jon

System Vitals: ChiliProject 3.0.0 ruby 1.8.7 (2011-12-28 patchlevel 357) [x86_64-linux] Rails 2.3.14 Ubuntu 11.10, 3.0.0-15-server, x86_64 Postgres 9.1

three18ti commented 12 years ago

I stopped apache, renamed

/home/git/.gitolite/hooks/common/post-receive

to

/home/git/.gitolite/hooks/common/post-receive

and it reinstalled the plugin and checks out now.

Don't forget to update the path as #!/usr/bin/env ruby does not work with RVM installs of Ruby.

 #!/usr/local/rvm/rubies/default/bin/ruby

https://github.com/ericpaulbishop/redmine_git_hosting/issues/125

jehoshua02 commented 12 years ago

I had an issue with git not seeing ruby on the path because I installed ruby under chili with rvm. I solved the issue by symlinking chili's ruby under /usr/local/bin, which is in the git user's path.

https://github.com/ericpaulbishop/redmine_git_hosting/issues/150