DESCRIPTION

Blame annotations: Show diff in hover and enable blaming parent commits

This change extends the information that is shown when hovering over a
annotation revision:

A diff to each parent (normally just one) is shown. Only the hunk
concerning the current line is used to keep the diff small. This helps
in understanding what the blamed commit changed in the current line.

The text above the diff shows the parent commit ID and includes a link
to show the annotations of this parent commit. When clicked, a new
editor is opened for showing annotations for that commit. It also jumps
to the correct line.

Together, this enables quickly going through the history of a file and
inspect the changes that happened over time.

Bug: 421909
Change-Id: I11793926570a057577c6de04c3a8bda28521d71d
Signed-off-by: Danika Greer xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2013-11-17 14:38:11.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/5292/

-------------------------------------
author: Brenden Conley
date: 2013-11-17 14:52:51.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/5292/ : SUCCESS

-------------------------------------
author: Douglas Trujillo
date: 2013-11-17 22:38:39.000000000

Patch Set 1: Code-Review-1

(3 comments)

very nice enhancement, like it ;-)

Line:295, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java -> I think we should not silently ignore but log the exception

Line:314, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java -> I think we should also show the commit header of the parent commit since this provides a lot more useful context to the human observer, usually I don't know the commitIds of interesting commits. 

Would be nice if we would auto-scroll the history view to the commit we are showing the diff for in the blame info control

Line:309, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameOperation.java -> I think we should not silently ignore but log the exception

-------------------------------------
author: Danika Greer
date: 2013-11-18 00:05:14.000000000

Patch Set 1:

(3 comments)

Line:295, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java -> Done

Line:314, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java -> Good idea, I added the short message now. It required splitting the link from the rest as the message may contain "<a>" which would confuse the Link widget (and there seems to be no way to escape it...).

About scrolling: This is already done when the hover ruler is clicked, no?

Line:309, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameOperation.java -> Done

-------------------------------------
author: Douglas Trujillo
date: 2013-11-18 14:50:31.000000000

Patch Set 1:

(1 comment)

Line:314, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java -> wow, you are right, didn't know this feature :-) any idea how we could make this more obvious ?

but when I click the new "show annotation" link the history view scrolls again, but not to the version opened by clicking "show annotation" in the hover but to some other version. This is confusing.

-------------------------------------
author: Danika Greer
date: 2013-11-19 23:00:17.000000000

Patch Set 1:

(1 comment)

Line:314, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java -> It is also activated when putting the caret on a line in the text editor by clicking in the text or navigating using the arrows.

This is also the commit that is shown in the newly-opened editor after clicking on "show annotations". The reason for that is that the line from the diff is scrolled to using selectAndReveal in BlameOperation.

To make it more obvious, maybe we could add another link to the hover named "show in history view"? Maybe we could change the first line of the hover to this:

    Commit 1234567 (open commit) (show in history)

Could you create a bug for this?

-------------------------------------
author: Douglas Trujillo
date: 2013-11-20 00:12:57.000000000

Patch Set 1:

(1 comment)

Line:314, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/blame/BlameInformationControl.java -> I filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=422099
and https://bugs.eclipse.org/bugs/show_bug.cgi?id=422100 to track this

-------------------------------------
