This branch could not be compared to its reference branch


If I set New Code > Project Settings to “Previous version” the first push of a branch always comes up green (but no analysis done), subsequent pushes “do the right thing” as long as the developer doesn’t rebase their branch. If they rebase all sorts of non-branch code starts showing up in the “new code” analysis.

If I change that and for New Code > Project Settings I set “Reference Branch: Main”:

… and for New Code > main branch I set “Previous version”.

I would expect that every branch would be compared against the main branch, what happens is that the New Code analysis comes up blank, with the message:

This branch could not be compared to its reference branch. See the SCM or analysis report for more details.

No matter how many times a branch is revised and pushed the same message appears.

Neither setting seems to work quite right.

Hi @Earl,

I’ve split your post into a new topic because I think it diverges (or will diverge) from the one you posted in.

We’re aware of some problems with rebasing (SONAR-14929, SONAR-15697) and we’re working on it now for 9.3 (E.T.A. at the end of the month).

Regarding this:

Could you share the full analysis logs, and probably even the full build logs? I’m particularly interested in

  • the checkout at the beginning of the build
  • any SCM-related messages at the end of analysis