Bug 439207 - Show Annotations does not handle the lines which were added and removed
Summary: Show Annotations does not handle the lines which were added and removed
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-09 05:43 EDT by Sarika Sinha CLA
Modified: 2015-06-30 15:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sarika Sinha CLA 2014-07-09 05:43:20 EDT
Example :
/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java

If I enable "Show annotations" and hover on line number 445 and 446, It shows few lines as added, but those line are not present now. 
It should also show which commit deleted those lines.
Comment 1 Markus Keller CLA 2014-08-07 09:46:57 EDT
git blame and Eclipse's Show Annotations don't show deleted lines.

In d975f27f12707ae6598994c5e3c6bd5e271d46c4 (last commit that touched LaunchConfigurationTabGroupViewer.java), the file contains:

	public void refresh() {
		if (fInitializingTabs) {
445			return;
446		}
		ILaunchConfigurationTab[] tabs = getTabs();

For lines 445 & 446, EGit shows commit 0d1c421 from 2007-09-05 and the hover says

@@ -494,2 +494,6 @@
 		}
+		if(fOriginal != null && fOriginal.isReadOnly()) {
+			updateButtons();
+			return;
+		}
 		ILaunchConfigurationTab[] tabs = getTabs();

"git blame" shows commit b536b520 from 2003-05-30 with diff

@@ -383,6 +383,10 @@
 	 * @see org.eclipse.jface.viewers.Viewer#refresh()
 	 */
 	public void refresh() {
+		if (isInitializingTabs()) {
+			return;
+		}
+		
 		ILaunchConfigurationTab[] tabs = getTabs();
 		if (!isInitializingTabs() && tabs != null) {
 			// update the working copy from the active tab

It's not really clear which blame annotations are "correct". Both commits insert
+			return;
+		}
, and a language-agnostic blame algorithm has a hard time finding out which commit actually should be blamed for the lines that made it into the current version. Especially since the line before also gets changed in b698122:
-		if (isInitializingTabs()) {
+		if (fInitializingTabs) {
Comment 2 Mykola Nikishov CLA 2015-06-30 15:55:32 EDT
[Batch change] Remove pre-3.7 Target Milestones

If anyone on CC list is going to fix/implement this, please assign a new 3.7+ target milestone.