Opened 13 years ago
Closed 9 years ago
#8844 closed defect (wontfix)
«No changeset HEAD in the repository»
Reported by: | Peter V. Saveliev | Owned by: | Herbert Valerio Riedel |
---|---|---|---|
Priority: | normal | Component: | GitPlugin |
Severity: | blocker | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
With
cached_repository = false persistent_cache = false
I've got «No changeset HEAD in the repository»
With
cached_repository = true persistent_cache = true
I've got «Invalid changeset number (No changeset 4553bfa7e59390cf8d0452119a22de5a7a7ef0ac in the repository)»
- Trac version: 0.12.1
- GitPlugin version: 2c2193164c4a79ff7c44cff47ffa3575a7bfd4b1 from git repo
How to check/reproduce:
- http url: http://projects.radlinux.org/cx/browser/
- git url: git://projects.radlinux.org/cx
This completely blocks GitPlugin usage on my repo :(
Any logs/traces I can attach on a request.
Attachments (0)
Change History (9)
comment:1 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 Changed 13 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Could you please explain your solution?
I have the same problem here, a true blocker, and I have no idea how to solve it.
comment:3 Changed 13 years ago by
It was really my fail. I have the installation:
- gitolite (user:group
gitolite:gitolite
) with home/var/lib/gitolite
- git daemon (running from xinetd under user gitolite)
- trac instance (running standalone under euid:egid
trac:tracadmin
So the main issue was to allow the trac instance to access to the gitolite repos. Firstly I just made chgrp -R tracadmin /var/lib/gitolite/repositories
, and trac worked... just up to the first git push
. After it, there was new git objects in the repository, again with gitolite:gitolite
instead of gitolite:tracadmin
.
I forgot the setgid bit on the repo directory. Now it is turned on, and all new files and directories are properly owned.
...
So, just make sure that trac instance can access every file in the git repository.
comment:4 follow-ups: 5 6 Changed 13 years ago by
I've got this message:
Invalid Changeset Number No changeset e38aaa447ca1d84f9043f4b1606f536c64b2de1e in the repository.
The sha1 code have 41 characters,
# echo e38aaa447ca1d84f9043f4b1606f536c64b2de1e | wc -m
and this plugin only support 40 characters. What I do now?
comment:5 Changed 13 years ago by
Well, if I set
[git] ## let Trac cache meta-data via CachedRepository wrapper cached_repository = true ## disable automatic garbage collection for in-memory commit-tree cache persistent_cache = true
This error occurr and I don't see the repository changesets on ticket, but if I set
[git] ## let Trac cache meta-data via CachedRepository wrapper cached_repository = false ## disable automatic garbage collection for in-memory commit-tree cache persistent_cache = false
I don't see both commit's effects on browse source and the repository changesets on tickets.
Replying to sfohart@gmail.com:
I've got this message:
Invalid Changeset Number No changeset e38aaa447ca1d84f9043f4b1606f536c64b2de1e in the repository.The sha1 code have 41 characters,
# echo e38aaa447ca1d84f9043f4b1606f536c64b2de1e | wc -mand this plugin only support 40 characters. What I do now?
comment:6 follow-up: 7 Changed 13 years ago by
I set the setgid bit on all files into repository
# chmod -R g+s /path/to/repository/git # find /path/to/repository/git -type d -print0 | xargs -0 chmod g+s
And the problem continue occurring
Replying to sfohart@gmail.com:
I've got this message:
Invalid Changeset Number No changeset e38aaa447ca1d84f9043f4b1606f536c64b2de1e in the repository.The sha1 code have 41 characters,
# echo e38aaa447ca1d84f9043f4b1606f536c64b2de1e | wc -mand this plugin only support 40 characters. What I do now?
comment:7 Changed 12 years ago by
Replying to sfohart@gmail.com:
I set the setgid bit on all files into repository
# chmod -R g+s /path/to/repository/git # find /path/to/repository/git -type d -print0 | xargs -0 chmod g+sAnd the problem continue occurring
Replying to sfohart@gmail.com:
I've got this message:
Invalid Changeset Number No changeset e38aaa447ca1d84f9043f4b1606f536c64b2de1e in the repository.The sha1 code have 41 characters,
# echo e38aaa447ca1d84f9043f4b1606f536c64b2de1e | wc -mand this plugin only support 40 characters. What I do now?
I ended up doing a really hacky post-receive hook that did chown and chmod to the repos directory:
#!/bin/sh chown -R git:www-data /home/git/repositories/repo.git chmod -R ug+rwx /home/git/repositories/repo.git
I'm sure there's a better way to do this, but I got tired of fighting it.
comment:8 Changed 12 years ago by
Here's my setup. Hope it helps someone:
- gitolite (user:group
git:git
) with home/home/git
- trac (user:group
trac:trac
)
Add trac to group git
adduser trac git
Set umask for new repositories, resulting in rw-r-----
(640) for files and (750) rwxr-x---
for directories.
perl -i.bak -pe 's/(UMASK\s+=>\s+)\d{4}/${1}0027/' /home/git/.gitolite.rc
Fix old repos:
find /home/git/repositories -type d -exec chmod 750 {} \; find /home/git/repositories -type f -exec chmod 640 {} \;
comment:9 Changed 9 years ago by
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
GitPlugin is deprecated. Please upgrade to Trac 1.0 and use TracGit.
Sorry, it was my mistake — non-trivial misconfiguration in file access rights