1

I want to use git shallow clone while checking out my repo. My objective is to reduce the Jenkins build time slightly. But the problem is I am getting thousands of warnings on the Jenkins build log. like following

[WARNING] Shallow clone detected, no blame information will be provided. You can convert to non-shallow with 'git fetch --unshallow'. [INFO] 0/4496 files analyzed [WARNING] Missing blame information for the following files:

I also get a warning on my SonarQube like this enter image description here

how I can get rid of this warning message.

TAMIM HAIDER
  • 641
  • 1
  • 10
  • 19
  • Related: [SonarQube SCM Integration](https://docs.sonarqube.org/latest/analysis/scm-integration/), [SO-37432290](https://stackoverflow.com/q/37432290/16586783) – Arun Kumar B Feb 18 '22 at 11:12

2 Answers2

1

Shallow clones are faster and smaller because they're skipping a part of the Git history.

Without a full history, it is (in general) impossible to determine who authored a specific part/line of the code.

Bottom line: if you depend on "blame" information, then you cannot use shallow clones.

The checkout per-se will work fine, but you're apparently using plugins that depend on this blame information, thus giving the warnings that you see.

Alex O
  • 7,746
  • 2
  • 25
  • 38
  • is there any possibility that I want to keep git-shallow clone but want to rid out these warnings as well in my Jenkins build? – TAMIM HAIDER Feb 21 '22 at 13:06
  • what last 2 lines mean- "The checkout per-se will work fine, but you're apparently using plugins that depend on this blame information, thus giving the warnings that you see." – TAMIM HAIDER Feb 21 '22 at 13:07
  • You can get rid of the warnings by de-installing all Jenkins plugins that depend on the "blame" information. – Alex O Feb 21 '22 at 13:26
  • which plugins u mean is responsible for these warnings. Sonarqube plugin u mean?? – TAMIM HAIDER Feb 28 '22 at 15:12
0

Blame warnings are part of the SCM plugin for SonarQube. Disable it from Sonarqube can be the solution. enter image description here

TAMIM HAIDER
  • 641
  • 1
  • 10
  • 19