CodeCompass icon indicating copy to clipboard operation
CodeCompass copied to clipboard

Git blame view doesn't work

Open bruntib opened this issue 6 years ago • 8 comments

When opening git blame view on the GUI, the CPU seems to be working but there is no result.

bruntib avatar Sep 18 '19 15:09 bruntib

If I remember correctly this issue was only faced with projects/files with a long history.

Based on the code I think the source of the issue will be, that GitServiceHandler::getBlameInfo creates the blame object through the libgit2 API, but then loads the metadata for all hunks (see line 266): https://github.com/Ericsson/CodeCompass/blob/ff4b4cf72998b1032aed6301f9b8f2ab7cbc3933/plugins/git/service/src/gitservice.cpp#L244-L314

Then the full history of the file is sent to the webclient. In the browser it seems like the blame history is loaded dynamically upon scrolling, but this is just a JavaScript effect on the client side, once the blame view is loaded for a file, there is no further communication with the webserver. (I have tested it.)

That's why it is so slow for files/projects with a large history, like LLVM.

mcserep avatar Oct 28 '19 00:10 mcserep

@bruntib @mcserep Does anyone remember in which particular file we had this issue? I remember it was in LLVM, but not the exact file. However, I could reproduce the problem for <llvm_root>/llvm/tools/gold/gold-plugin.cpp, to add an example. The GitService returned a (failed) net::ERR_EMPTY_RESPONSE error for this file's git blame.

intjftw avatar Jul 16 '20 15:07 intjftw

@bruntib @mcserep Does anyone remember in which particular file we had this issue? I remember it was in LLVM, but not the exact file. However, I could reproduce the problem for <llvm_root>/llvm/tools/gold/gold-plugin.cpp, to add an example. The GitService returned a (failed) net::ERR_EMPTY_RESPONSE error for this file's git blame.

@intjftw Does executing blame with the Git CLI succeeds for this file? (To verify that the issue is not with git/libgit itself.)

mcserep avatar Jul 16 '20 15:07 mcserep

@mcserep Yes, it executes in less than 1 minute.

intjftw avatar Jul 16 '20 15:07 intjftw

An example page where the git/blame takes timeout http://poirot.codechecker.gic.ericsson.se:8301/#wsid=ml66_proj&fid=17940882928923629289&select=40|9|53|14&center=text

zporky avatar Jul 18 '20 17:07 zporky

Something is terribly wrong on the site linked by @zporky, potentially not really related to the Git plugin. The database behind that server is corrupted. I am clicking around, and constantly getting errors in JS like this:

11:32:29.318 Uncaught 
Object { message: "TException - service has thrown: InvalidId(msg=Invalid CppAstNode ID, fid=<null>, nodeid=0)", code: 0, stack: "" }
codemirror.js:3924:29

whisperity avatar Jul 20 '20 09:07 whisperity

What is the status of this bug report @intjftw ? Is it still present or has it been resolved?

mcserep avatar May 08 '21 20:05 mcserep

I reevaluated this with the current Gershwin version, and fetching the blame info for files with a long history (e.g. CREDITS.TXT for the LLVM project) still takes a very long time.

mcserep avatar Feb 04 '24 11:02 mcserep