SVN blame in Eclipse
Asked Answered
A

1

87

Yesterday, I discovered the Subversion (SVN) blame feature, and I was wondering, is this feature available from Eclipse?

Advisedly answered 21/10, 2008 at 21:56 Comment(1)
I believe the politically correct term is "Annotate", not blame (even though it's best used for blaming others ;) )Tervalent
T
110

As was pointed out, you would currently have to first install a plug-in to enable Subversion support. I recommend Subversive, myself, and a search here on Stack Overflow for the tags "eclipse" and "subversion" together will show several previous threads regarding "gotchas" to watch out for when installing the connectors (Subversive is separated into two parts-- the core support and "connectors" that provide the SVN glue).

Once you have that installed, you can configure repositories, create new projects by directly entering a new repository address and checking it out, or associate an existing project that was already attached to SVN with the repository by have Subversion look it over.

Once you've done that, this is how you access the "svn blame" command, also known as "annotate" or "praise":

For a resource, right click on the resource name in the file-explorer pane to pop-up the context menu (you can also get this menu by right-clicking anywhere in the editor itself). Under the "Team" heading (which is also where you access all the SVN commands, as Eclipse generalizes source control under the heading of "Team Sharing"), select "Show Annotation". On my Mac PowerBook, the keyboard shortcut for this is Ctrl + Option + A, I'm not near my Linux or Windows XP platforms to see what the shortcut us on either of them (Mac OS X ports tend to tweak keyboard shortcuts to adhere to the "greater good" view of what a Mac application should do).

After a bit of time conversing with the Subversion repository, the left-gutter of the editor window will show a series of colored bars. If you have line-numbers enabled for your editor, these will overlay the numbers. Otherwise, they'll just be bars. Each alternation of color represents a break where responsibility changes from one user to another. If you hover the pointer over a bar, a tooltip will appear identifying the responsible user, the revision/commit that the lines are from, date and the check-in comment. The color of the bars will vary from committer to committer, and revision to revision. They'll be varying shades of the same base color, but Eclipse will try to make them visually distinct (as much as possible). When you're hovering over a snippet, it highlights slightly, and all other bars that are tied to the same revision will also highlight.

(Now, don't ask me how to turn it off. Thus far, my only solution has been to close the buffer and re-open it!)

Toback answered 22/10, 2008 at 2:3 Comment(4)
Great! I have been using Subversive for ages and never realize about the "Show Annotation" feature, that exactly that i was looking for, thanks!Advisedly
Great explanation thanks :) To turn it off you can right click the highlighting at the left and click Revisions > Hide Revision Information. This is also where you can specify how it colours annotations. I'm fond of the Combined Coloring, so I can have each contributor a different colour and older revisions by the same comitter a lighter shade of that colour.Anders
Another way to turn it off is to right click bar and deselect "Show Quick Diff", Quick diff will automatically turn on next time you show Annotations (though it will give you an annoying dialog). The shortcut for this is Shift+Ctrl+Q (Ubuntu) so pressing this twice is a quick and simple way of turning Annotations off and still having your Quick Diff bar and not getting the dialog.Subaxillary
I wanted to upvote, but there was just soooo much useless information before the answer that I won't upvote. Nevertheless, thanksUtah

© 2022 - 2024 — McMap. All rights reserved.