Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 426818

Summary: Last line has no blame
Product: [ECD] Orion Reporter: Evan Hughes <evan_hughes>
Component: EditorAssignee: Project Inbox <orion.editor-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: cbmcgee, gheorghe
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Sample missing line none

Description Evan Hughes CLA 2014-01-28 11:58:40 EST
Some files don't get blame for their last line. This seems to depend on the line terminators of the previous line, but I haven't dug too deeply into it. 

See the included screen shot.
Comment 1 Evan Hughes CLA 2014-01-28 12:01:31 EST
Created attachment 239399 [details]
Sample missing line

The blame service returns the following:
{
AuthorEmail: "ADMIN"
AuthorImage: ""
AuthorName: "ADMIN"
CommitLink: "http://noclue"
CommitLocation: "http://commitLocation"
End: 13
Message: "Share"
Name: "Share"
Shade: 1
Start: 1
Time: "21/1/2014 23:57:12"
}

Bumping 'End' up to 14 in the debugger doesn't solve the problem - it prevents blame from being rendered.
Comment 2 Bogdan Gheorghe CLA 2014-01-28 12:05:30 EST
If I recall correctly, we took a look at this before and we found that it was a problem in JGit. It wasn't giving the info for the last line - I think we saw the same behavior in Eclipse too.
Comment 3 Chris McGee CLA 2014-01-28 13:04:33 EST
In my experiments it seems that the editor is showing an extra line for every file. If I download a file from Orion and open it up with vi I see one less line than in the Orion editor.
Comment 4 Bogdan Gheorghe CLA 2014-01-28 13:13:15 EST
vi is different - try the same file in Eclipse with EGit.
Comment 5 Chris McGee CLA 2014-01-28 14:08:45 EST
I will take some time to set up an Eclipse + EGit environment. In the mean time, I ran the following command on a file I downloaded from Orion:

cat myFile.txt | wc -l

It gives me an answer of "452" but the Orion editor shows a line 453. Where does this line come from?
Comment 6 Chris McGee CLA 2014-01-29 09:14:29 EST
Annotating the same file in EGit shows a similar blank line at the bottom without any blame.

It appears that Eclipse and Orion show an extra line, which is different than the rest of the Unix world does, including git.
Comment 7 Evan Hughes CLA 2014-01-29 10:01:48 EST
(In reply to Bogdan Gheorghe from comment #2)
> If I recall correctly, we took a look at this before and we found that it
> was a problem in JGit. It wasn't giving the info for the last line - I think
> we saw the same behavior in Eclipse too.

I've tried manually fudging the 'End' property of the annotation object to be n+1 or n-1 and that hasn't helped. My screenshot in comment 1 shows an annotated file. If I hand-modify the blame service output to have an 'End' property that is n+1 (ie 14, in this case), the annotation fails entirely.
Comment 8 John Arthorne CLA 2015-05-05 16:20:13 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html