Edgewall Software
Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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. [git] git_bin option uses better default on Windows.

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  
    199199    git_fs_encoding = Option('git', 'git_fs_encoding', 'utf-8',
    200200        """Define charset encoding of paths within git repositories.""")
    201201
    202     git_bin = PathOption('git', 'git_bin', '/usr/bin/git',
     202    git_bin = Option('git', 'git_bin', '/usr/bin/git',
    203203        """Path to git executable (relative to the Trac configuration folder,
    204204        so better use an absolute path here).""")
    205205

Attachments (0)

Change History (9)

comment:1 by Christian Boos, 12 years ago

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.""").

comment:2 by fbrettschneider@…, 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.

in reply to:  2 ; comment:3 by Christian Boos, 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.

in reply to:  3 comment:4 by fbrettschneider@…, 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:5 by Christian Boos, 12 years ago

Jun, do you plan to commit that one as well?

comment:6 by Jun Omae, 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 Christian Boos, 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 Jun Omae, 12 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: newclosed

Yes. Most linux users have probably git command in the PATH environment. Committed in [11519-11520].

comment:9 by Jun Omae, 12 years ago

Owner: set to Jun Omae

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.