Ericsson / CodeCompass

CodeCompass is a software comprehension tool for large scale software written in C/C++ and Java
https://codecompass.net
GNU General Public License v3.0
520 stars 102 forks source link

Fix for git blame issue with submodules #538

Closed Fardas closed 2 years ago

mcserep commented 3 years ago

Side note: next time it would be a better idea to create a feature branch for your development. Since you have worked on the master branch of your fork, there will be a divergence in Git history after your PR gets accepted and you will have to reset your own master branch to the state of the upstream master branch.

mcserep commented 2 years ago

I have only found one issue: if a file in a subrepository is right clicked in the File Manager, then a "[ERROR] Getting tree entry failed: -3" error message is logged by the webservice. Source of error: https://github.com/Fardas/CodeCompass/blob/master/plugins/git/service/src/gitservice.cpp#L766 (Git Blame works nevertheless for subrepo files.)

The source of the issue is that in getRepositoryByProjectPath all repositories are iterated over and while it is checked that the path of the examined repository is the prefix of the file's path, the path of the main repository will most likely prefix ALL files.

mcserep commented 2 years ago

The source of the issue is that in getRepositoryByProjectPath all repositories are iterated over and while it is checked that the path of the examined repository is the prefix of the file's path, the path of the main repository will most likely prefix ALL files.

Fixed this in 112c0ee0fe75e35a4d61454e946379998ad0f279. It is strange though you have not faced this issue @Fardas .