id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,branch,changelog,apichanges,internalchanges 10605,GitPlugin: GitNode *must* throw NoSuchNode on invalid revisions for Bitten to work,Peter Suter,Jun Omae,"''Created as part of the [ticket:10594 move of GitPlugin]. Tickets originally reported for th:GitPlugin: th:#9879'' Quoting [th:ticket:9879 dvdkhlng]: > When git revisions are lost in a repository (due to rebases or whatever), and the [http://bitten.edgewall.org Bitten plugin] already had build such a revisions, then it will later die with a {{{NoSuchChangeset}}} excption while showing the Timeline. > > A very similar probmlem existed for Bitten ([http://bitten.edgewall.org/ticket/606 see Bitten ticket 606]) with SVN repositories and was [http://bitten.edgewall.org/changeset/962 fixed already]. However that fix does not generalize to Git repositories, as [https://github.com/hvr/trac-git-plugin/blob/master/tracext/git/git_fs.py GitNode.__init_ ] (called from {{{GitRepository.get_node}}}) does not throw {{{NoSuchNode}}} on invalid revisions if path is '/' (it ''does'' throw for all paths != '/'). > > So Bitten calls {{{repo.get_node}}} with an invalid revision, which succeeds (this part is try/catch protected). And later dies when calling {{{repo.normalize_rev}}} (this part is not protected). > > What would be the correct fix? Is it sufficient to pull the ls_tree_info assignment and result check out of the {{{if p:}}} block in the {{{GitNode}}} constructor? ",defect,closed,low,1.0.2,plugin/git,,normal,fixed,,,,Raise `NoSuchChangeset` from `GitNode.__init__` for invalid revision even if path is `'/'`,,