Sonar-scanner unable to fetch the git blame information

Hi,

My source code checkout happens in different directory while the the build happens in completely different location where the .git folder is not present. While I perform the sonar-scanner analysis for C/C++ files I need to give the location of build directory where the .git folder is not present.

In this scenario, I am not able to collect the git blame information. Are there any other possibilities where I can get the git information so as to assign issues to developers automatically?

Hi Rocky,

Please make sure to share the must-share information here when posting for help: I am missing your SonarQube version, SonarScanner version, any logs, etc.

When scanning C/C++, you will be using the build-wrapper followed by launching the SonarScanner. What you pass to the sonar scanner is the directory with the output of the build-wrapper process execution via the sonar.cfamily.build-wrapper-output parameter. The root directory of the project you are analysing should contain the .git folder so that the SonarScanner picks up blame data information, and you should launch SonarScanner from this folder.

Hope it helps, cheers,
Daniel