.git-blame-ignore-revs file is not taken into account

With .git-blame-ignore-revs file one can specify revisions, which should be ignored by git blame.
This file is not taken into account by sonar scanner, when collecting the information from git, which leads to incorrect git blame information being saved in Sonar.

Hello @Michael_Kraft,

You can try to force the scanner to use the native git blame strategy by setting the analysis property sonar.scm.use.blame.algorithm=GIT_NATIVE_BLAME.
However, this may have a performance impact.
Could you give it a try? Thanks.

1 Like

Thank you, Eric!
It was possible to try the solution, which you’ve proposed and partially it addressed an issue. The .git-blame-ignore-revs file is taken into account now, but only the author information is ignored in Sonar. Sonar still interprets the change, made in .git-blame-ignore-revs commits as a change to the code and that affects the new code scan results.
Is there a way to configure Sonar to ignore particular commits from being taken into account, when identifying code as new code?
Thank you in advance!

Hi @Michael_Kraft,

If there is no SCM info at all on a line after you’ve put the commit in .git-blame-ignore-revs, the associated issues are dated with the analysis date and will be considered new code.
Otherwise, the issue would be dated with the previous blame info on the line, which may or may not be part of new code.

It’s not possible to ignore commits.