Opened 9 years ago

Closed 9 years ago

#4139 closed defect (fixed)

GitPlugin doesn't handle fresh repositories well

Reported by: mail@… Owned by: Herbert Valerio Riedel
Priority: normal Component: GitPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


When using GitPlugin with a repository that hasn't been used yet, it just displays an AssertionError without further details.

Do this to reproduce it:

  • Create a new git-repository using
git init && git add .
  • Point your trac.ini to this repository
  • Point your webbrowser to your trac

What happens?

  • This error message is displayed in the web browser:
    Trac detected an internal error:
  • This lines are displayed in your trac logfile:
    2008-11-21 17:48:50,627 Trac[git_fs] INFO: detected GIT version
    2008-11-21 17:48:50,635 Trac[PyGIT] DEBUG: PyGIT.Storage instance 29644272 constructed
    2008-11-21 17:48:50,636 Trac[PyGIT] DEBUG: requested PyGIT.Storage instance 29644272 for '/var/repositories/git/timetracker/.git'
    2008-11-21 17:48:50,640 Trac[git_fs] INFO: enabled CachedRepository for '/var/repositories/git/timetracker/.git'
    2008-11-21 17:48:50,666 Trac[PyGIT] DEBUG: triggered rebuild of commit tree db for 29644272
    2008-11-21 17:48:50,706 Trac[PyGIT] DEBUG: rebuilt commit tree db for 29644272 with 0 entries
    2008-11-21 17:48:50,712 Trac[main] ERROR: 
    Traceback (most recent call last):
      File "/usr/lib64/python2.5/site-packages/trac/web/", line 432, in _dispatch_request
      File "/usr/lib64/python2.5/site-packages/trac/web/", line 174, in dispatch
      File "/usr/lib64/python2.5/site-packages/trac/web/", line 295, in _pre_process_request
        chosen_handler = filter_.pre_process_request(req, chosen_handler)
      File "/usr/lib64/python2.5/site-packages/trac/versioncontrol/", line 86, in pre_process_request
      File "/usr/lib64/python2.5/site-packages/trac/versioncontrol/", line 115, in sync
        repos_youngest = self.repos.youngest_rev
      File "/usr/lib64/python2.5/site-packages/trac/versioncontrol/", line 279, in <lambda>
        youngest_rev = property(lambda x: x.get_youngest_rev())
      File "build/bdist.linux-x86_64/egg/tracext/git/", line 189, in get_youngest_rev
        return self.git.youngest_rev()
      File "build/bdist.linux-x86_64/egg/tracext/git/", line 331, in youngest_rev
        return self.rev_cache[0]
      File "build/bdist.linux-x86_64/egg/tracext/git/", line 316, in get_rev_cache
        assert all(e is not None for e in self.__rev_cache)

How was this problem resolved?
By doing a

git commit -m "Initial commit"

in the repository

What should happen instead?
The GitPlugin should know how to handle this case and display a message like

Your repository can't be used for now - please do a initial commit first!

What software/version were used?

  • apache-2.2.9
  • mod_python-3.3.1
  • python-2.5.2
  • git-
  • trac-0.11.2
  • gitplugin from Nov. 21th, 2008

Attachments (0)

Change History (1)

comment:1 Changed 9 years ago by Herbert Valerio Riedel

Resolution: fixed
Status: newclosed

fixed in r5378

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Herbert Valerio Riedel.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.