JGIT fails to blame file with "-w" option

906 views
Skip to first unread message

herbert.mo...@gmail.com

unread,
Aug 22, 2016, 2:05:52 PM8/22/16
to SonarQube
JGIT version: 4.4.1.
-----------------------------------------
Description:

"blame -w" fails whereas simple "blame" works fine for the very same file.

If I use Git version 1.7.9.5 on Ubuntu 12.04 it blames the same file with "-w" option, which makes me think that it is JGIT issue.
-----------------------------------------

-----------------------------------------
I use SonarQube in conjunction with Jenkins, below are error messages from Jenkins:

ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to blame file <filename>.cpp
	at org.sonarsource.scm.git.JGitBlameCommand.blame(JGitBlameCommand.java:128)
	at org.sonarsource.scm.git.JGitBlameCommand.access$000(JGitBlameCommand.java:44)
	at org.sonarsource.scm.git.JGitBlameCommand$1.call(JGitBlameCommand.java:112)
	at org.sonarsource.scm.git.JGitBlameCommand$1.call(JGitBlameCommand.java:109)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at org.eclipse.jgit.blame.BlameGenerator.getSourceStart(BlameGenerator.java:870)
	at org.eclipse.jgit.blame.BlameResult.loadFrom(BlameResult.java:338)
	at org.eclipse.jgit.blame.BlameResult.computeAll(BlameResult.java:240)
	at org.eclipse.jgit.blame.BlameGenerator.computeBlameResult(BlameGenerator.java:450)
	at org.eclipse.jgit.api.BlameCommand.call(BlameCommand.java:230)
	at org.sonarsource.scm.git.JGitBlameCommand.blame(JGitBlameCommand.java:126)
	... 7 more
-----------------------------------------

Let me know, what else diagnostic/investigatory can be done to allocate the cause of the problem, for now I have just excluded this file from SonarQube analysis.

Julien HENRY

unread,
Aug 24, 2016, 11:39:31 AM8/24/16
to SonarQube, herbert.mo...@gmail.com
Hi Herbert,

Have you manually updated the version of JGit used in the SonarQube Git Plugin? Because AFAIK latest version (1.2) uses JGit 4.2.0.
 
If you confirm you have the issue with latest release of JGit (4.4.1) even using the JGit command line client then the best option would be to report the issue directly to JGit bugzilla.

++

Julien

Julien HENRY

unread,
Aug 24, 2016, 11:47:38 AM8/24/16
to SonarQube, herbert.mo...@gmail.com

herbert.mo...@gmail.com

unread,
Aug 24, 2016, 3:11:05 PM8/24/16
to SonarQube, herbert.mo...@gmail.com
Hi Julien,

Yes, I have manually updated JGit to 4.4.1, and looks like issue is already being investigated, I'll keep on eye on the thread you gave.

Thanks,
Herbert
Reply all
Reply to author
Forward
0 new messages