New Code setting - difference from branch from specific version in history

Info about SQ version:
Enterprise Edition 9.4

Hi,
I would like to ask how to set up on SonarQube New Code setting - difference from branch from specific version in history

So far, I’ve tried the following procedure

  1. I set in New Code settings for a concrete branch: “Reference branch”

  2. I set “Specific analysis” for this “Reference branch”

Unfortunately, the New Code shows me a lot more changes after analysis. It seems that the analysis compares the branches according to the latest analyzes.

Thank you for any advice
Petra

Hey there.

That’s correct – the reference brench assumes you want to compare to the latest version of that branch.

You could, if necessary, create a branch in your repository locked to a specific commit of your reference branch (like when one would make a branch for a maintenance release) and then use that as your reference branch.

Thank you for answer.
In the end, I solved it this way. For each branch I have a reference branch with the version of the last “integration” and against it I make a diff for “incremental coverage”.