#10997 closed defect (fixed)
"GIT backend not available" on OpenSUSE
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.1 |
Component: | plugin/git | Version: | 1.0 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fixed not working git backend with symlink'ed git executable. |
||
API Changes: | |||
Internal Changes: |
Description
Git module doesn't work on OpenSUSE. The issue from th:#8682 and https://bugzilla.novell.com/show_bug.cgi?id=697156.
Trac [/tmp/tracenv]> repository resync '' 17:23:16 Trac[git_fs] ERROR: GitError: Could not retrieve GIT version (tried to execute/parse '/usr/bin/git-receive-pack --version' but got ValueError('need more than 0 values to unpack',)) TracError: GIT backend not available
/usr/bin/git
in OpenSUSE is a symbolic link and Trac wrongly follows the link.
linux@linux:/> ls -l /usr/bin/git lrwxrwxrwx 1 root root 18 Dec 26 16:58 /usr/bin/git -> ../lib/git/git-add
Trac should use Option
instead of PathOption
, confirmed with OpenSUSE 12.2.
-
tracopt/versioncontrol/git/git_fs.py
old new 199 199 git_fs_encoding = Option('git', 'git_fs_encoding', 'utf-8', 200 200 """Define charset encoding of paths within git repositories.""") 201 201 202 git_bin = PathOption('git', 'git_bin', '/usr/bin/git',202 git_bin = Option('git', 'git_bin', '/usr/bin/git', 203 203 """Path to git executable (relative to the Trac configuration folder, 204 204 so better use an absolute path here).""") 205 205
Attachments (0)
Change History (9)
comment:1 by , 12 years ago
follow-up: 3 comment:2 by , 12 years ago
I see a similar error with Bitnami-Trac-1.0.0, "Native" on Windows:
[2013-01-07 12:11:49,723 p3156:t2624] git_fs.py:117 ERROR: GitError: Could not retrieve GIT version (tried to execute/parse 'd:\usr\bin\git --version' but got WindowsError(3, 'The system cannot find the path specified')) [2013-01-07 12:12:29,552 p2384:t3536] main.py:511 WARNING: [172.20.20.85] HTTPInternalError: 500 Trac-Fehler (GIT backend not available)
The path D:\usr\bin\git is wrong. There aint no such path on my Windows server here.
follow-up: 4 comment:3 by , 12 years ago
Replying to fbrettschneider@…:
… The path D:\usr\bin\git is wrong. There aint no such path on my Windows server here.
Well, that wrong path is as "good" as any other wrong path… On Windows we have no way to figure out where you installed git, so you have to configure this in the .ini.
comment:4 by , 12 years ago
Replying to cboos:
Well, that wrong path is as "good" as any other wrong path… On Windows we have no way to figure out where you installed git, so you have to configure this in the .ini.
I see, thanks for the hint, didn't know that. I just read wiki:TracGit and it wasn't mentioned there. Perhaps, it's a good idea to test the default path if there is such git executable located, and give a warning message if not.
comment:6 by , 12 years ago
I just committed the patch with your suggestions in [11512-11513]!
Well, it might good to be git
as default of the option for Windows users….
comment:7 by , 12 years ago
Well, now that you propose it, if that's also a sane choice on Linux, we should make it that way.
comment:8 by , 12 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Yes. Most linux users have probably git
command in the PATH environment. Committed in [11519-11520].
comment:9 by , 12 years ago
Owner: | set to |
---|
Ok, though it's a path we deal with here, we don't want the special handling of relative paths that
PathOption
does. Patch is fine for me, except for the docstring which should be adapted to the change (e.g."""Absolute path to the git executable."""
).