Git repos not browsable, diffs report revision not found in repos

Added by Dan Lentz over 9 years ago

I apologize if this has been answered elsewhere I've looked through the forums and found similar postings but none of the resolutions seem applicable.

I'm running the redmine (svn current) and git 1.5.4.5 under MacOSX 10.5

I have the repository path defined to be the path to local .git directory (/Volumes/data/ebugs/htdocs/bong/.git)

the Latest revisions show up like a champ under the repository tab, however the repos doesn't show up so as to allow browsing. Also, clicking "view differences" gives me a red x error "The entry or revision was not found in the repository."

fs level permissions on the repo appear correct

Also, the following appears in the log:

Processing RepositoriesController#diff (for 127.0.0.1 at 2008-05-06 20:47:57) [GET]
  Session ID: dbefbb6f4ecd4f3084a4d275fa910903
  Parameters: {"rev"=>"6ea5e54fb6233292f09ac8321e90986245643f5d", "action"=>"diff", "id"=>"bong", "controller"=>"repositories", "path"=>[]}
Rendering template within layouts/base
Completed in 0.09722 (10 reqs/sec) | Rendering: 0.04917 (50%) | DB: 0.00000 (0%) | 500 Internal Server Error [http://ebu.gs/repositories/diff/bong?rev=6ea5e54fb6233292f09ac8321e90986245643f5d]

I'd be very grateful if anyone has suggestions or could point me in the right direction

redmine is really sweet my users are all over me to get this resolved!

I'm a lisp-er just getting acclimated to ruby (and git), so I apologize again if this posting betrays my stupidity.

thanks again
dan

Replies (12)

RE: Git repos not browsable, diffs report revision not found in repos - Added by Calvin Cheng over 9 years ago

Hi Dan,

Have you committed any files in the git repository? Or is it just a bare git repo?

I am not an expert but that was my problem when I had the "The entry or revision was not found in the repository" problem.

I had a bare git repo and when I committed my first file, it worked.

Regards,
Calvin

RE: Git repos not browsable, diffs report revision not found in repos - Added by Calvin Cheng over 9 years ago

If it's not a bare repo problem and this is your first time trying to view the repository view in redmine, you need to send the change-sets/commit messages etc into your redmine database. To do that, you will need to run the following command in your redmine root directory:

"ruby script/runner "Repository.fetch_changesets" -e production"

See wiki: http://www.redmine.org/wiki/redmine/RedmineRepositories

Regards,
Calvin

RE: Git repos not browsable, diffs report revision not found in repos - Added by Dan Lentz over 9 years ago

thanks for your reply, but, yup there are definitely some commits. I can browse the repo via filesystem and verify everything is in place.

This gave me the idea that maybe it needs to be the "master" and so I tried changing to point to master origin repo (over nfs), but same result, so I don't think it's that, either. (I'm willing to try again with a clean master repo on local disk if anyone vouches that this is the case tho)

thanks again

RE: Git repos not browsable, diffs report revision not found in repos - Added by Dan Lentz over 9 years ago

regarding "ruby script/runner "Repository.fetch_changesets" -e production"

thanks for the reply, but i've definitely fetched the changesets. Actually I plan to do this hourly via cron (launchd) once things are running and stable.

but thanks again for your response

RE: Git repos not browsable, diffs report revision not found in repos - Added by Calvin Cheng over 9 years ago

Hi Dan,

Sorry I couldn't help more...

Seems like you have got the few items (which gave me trouble) correct.

Regards,
Calvin

RE: Git repos not browsable, diffs report revision not found in repos - Added by Dan Lentz over 9 years ago

y thats what is puzzling me.

as an update, I just tried to set this up from scratch, still with the same result:

% mkdir /Volumes/data/ebugs/htdocs/bong
% cd /Volumes/data/ebugs/htdocs/bong
% git init
% touch file.txt
% git add .
% git commit

go to project settings -- repository and add the following git repo

 /Volumes/data/ebugs/htdocs/bong/.git

go to redmine directory and execute the following

ruby script/runner "Repository.fetch_changesets" -e production

grr. So that should be, like, the minimal test case, no? What am I doing wrong?

What are the required rows in the database? -- I can go in and verify by hand if someone has a short list of what these should contain.

hooray for me I'm a dunce - Added by Dan Lentz over 9 years ago

Ok, thanks to everyone for their help -- it helped me just to talk through this.

And the answer is: git was not in the PATH of the process running the redmine server.

Well, who knows, this might be helpful if some other newbie stumbles into the same problem.

Maybe it could be helpful if a message indicating the problem were logged. I only figured it out from the logs generated by launchd. As far as I can tell redmine doesn't log the error.

Thanks again,
dan

RE: RE: Git repos not browsable, diffs report revision not found in repos - Added by Marcin Gil over 9 years ago

How did you get this in PATH? I set up mine in .bashrc however it seems that these settings are not taken into consideration by Rails app (I am using FCGI access, not mongrel).

I have git installed in ~/bin/.

RE: Git repos not browsable, diffs report revision not found in repos - Added by Nigel Soon over 9 years ago

I also had this problem and found the easiest solution was just to make a symbolic link.

Marchin, try:

ln -s ~/bin/git /usr/bin/git

RE: Git repos not browsable, diffs report revision not found in repos - Added by Marcin Gil over 9 years ago

This is simply not doable on shared hosting environment like Site5 is. I don't have writable access to /usr/bin there ;)

RE: Git repos not browsable, diffs report revision not found in repos - Added by Thomas Lecavelier over 9 years ago

But you have full rights to your PATH env variable...

RE: RE: Git repos not browsable, diffs report revision not found in repos - Added by Marcin Gil over 9 years ago

Sorry for late answer (btw. I didn't get email notification).

Yes, I do. And in .bashrc I have it set so I can use git on ssh successfully. However I think that .bashrc is not used/parsed when I use Redmine/Rails via FastCGI access. And I don't have enough knowledge on FastCGI where to set PATH internally for it.

(1-12/12)