id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release 4139,GitPlugin doesn't handle fresh repositories well,mail@…,Herbert Valerio Riedel,"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:'''[[BR]] - Create a new git-repository using {{{ git init && git add . }}} - Point your ''trac.ini'' to this repository[[BR]] - Point your webbrowser to your trac[[BR]] '''What happens?'''[[BR]] - This error message is displayed in the web browser: {{{ Trac detected an internal error: AssertionError: }}} - This lines are displayed in your trac logfile: {{{ 2008-11-21 17:48:50,627 Trac[git_fs] INFO: detected GIT version 1.5.6.4 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/main.py"", line 432, in _dispatch_request dispatcher.dispatch(req) File ""/usr/lib64/python2.5/site-packages/trac/web/main.py"", line 174, in dispatch chosen_handler) File ""/usr/lib64/python2.5/site-packages/trac/web/main.py"", line 295, in _pre_process_request chosen_handler = filter_.pre_process_request(req, chosen_handler) File ""/usr/lib64/python2.5/site-packages/trac/versioncontrol/api.py"", line 86, in pre_process_request self.get_repository(req.authname).sync() File ""/usr/lib64/python2.5/site-packages/trac/versioncontrol/cache.py"", line 115, in sync repos_youngest = self.repos.youngest_rev File ""/usr/lib64/python2.5/site-packages/trac/versioncontrol/api.py"", line 279, in youngest_rev = property(lambda x: x.get_youngest_rev()) File ""build/bdist.linux-x86_64/egg/tracext/git/git_fs.py"", line 189, in get_youngest_rev return self.git.youngest_rev() File ""build/bdist.linux-x86_64/egg/tracext/git/PyGIT.py"", line 331, in youngest_rev return self.rev_cache[0] File ""build/bdist.linux-x86_64/egg/tracext/git/PyGIT.py"", line 316, in get_rev_cache assert all(e is not None for e in self.__rev_cache) AssertionError }}} '''How was this problem resolved?'''[[BR]] By doing a {{{ git commit -m ""Initial commit"" }}} in the repository '''What should happen instead?'''[[BR]] 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?'''[[BR]] - apache-2.2.9[[BR]] - mod_python-3.3.1[[BR]] - python-2.5.2[[BR]] - git-1.5.6.4[[BR]] - trac-0.11.2[[BR]] - track-hacks.org gitplugin from Nov. 21th, 2008[[BR]] ",defect,closed,normal,GitPlugin,normal,fixed,,,0.11