Subversion blame

While reading about git I found a feature of Subversion that I never used. It’s called svn blame and will show each line of a file with information about who last changed that line and in what revision. Running svn blame vendor/plugins/project_scores_plugin/init.rb for one of my Redmine plugins shows this:

     2     edavis # Redmine sample plugin
     2     edavis require 'redmine'
     2     edavis 
     2     edavis RAILS_DEFAULT_LOGGER.info 'Starting Project Scores plugin for Redmine'
     2     edavis 
     2     edavis Redmine::Plugin.register "scores_plugin" do
     2     edavis   name 'Project Scores Plugin'
     2     edavis   author 'Eric Davis of Little Stream Software'
     2     edavis   description 'This is a scoring plugin for Redmine that will allow projects to be scored'
     2     edavis   version '0.0.1'
     2     edavis 
     2     edavis   # This plugin adds a project module
     2     edavis   # It can be enabled/disabled at project level (Project settings -> Modules)
     2     edavis   project_module :score_module do
     2     edavis     # This permission has to be explicitly given
     2     edavis     # It will be listed on the permissions screen
     3     edavis     permission :view_scores, {:scores => [:index]}
     3     edavis     permission :edit_scores, {:scores => [:edit]}
    14     edavis     permission :view_score_options, {:score_options => [:index]}
    14     edavis     permission :edit_score_options, {:score_options => [:edit]}
     2     edavis   end
     2     edavis 
     2     edavis   # A new item is added to the project menu (because Redmine can't add it anywhere else)
     3     edavis   menu :project_menu, "Scores", :controller => 'scores', :action => 'index'
     2     edavis end

From that I can see the majority of the file was created on r2 the ‘score_options’ were added on r14. I’m still amazed whenever I find a new useful feature in my tools.

Eric

About Eric Davis

I founded Little Stream Software where I help new entrepreneurs build a successful software business. I also created an ebook, Redmine Tips, where I show you how to become more productive using Redmine. I am also the author of Refactoring Redmine, where I go about refactoring Rails using Redmine as an example. Follow me on Twitter and Google Plus.

,

4 Responses to Subversion blame

  1. Ben Strackany August 11, 2009 at 10:34 pm #

    Yep, I love this feature, too. I especially like the fact that they call it by one of it’s most common goals — find out who to blame for something. :)

    • Grant Thomas October 22, 2012 at 3:21 pm #

      Ironic to you it will be, then, that ‘praise’ and ‘annotate’ (and ‘ann’) are synonyms for ‘blame’.

  2. Mohammad El-Abid May 12, 2011 at 5:22 am #

    Does git support this? Googiling to find a Redmine plugin to do this.

    • edavis10 May 12, 2011 at 3:02 pm #

      `git blame` works the same way.

Leave a Reply