2

What is a good open-source tool for blaming / praising / annotating code (or other text that has a history)?

What I mean is a tool to take code that has a history in source control and show which line came from which revision / version.

I would prefer one that detects lines that were moved, too. And it has to be open source.

Update: I want to view/use its code, not just use the tool itself.

Lev
  • 6,487
  • 6
  • 28
  • 29

2 Answers2

2

Almost all version control systems include functionality like this (I'd say that versioning systems that don't are broken). If you're using CVS, the comand is cvs annotate; if you're using Subversion, it's svn blame. The right way to do this is going to be specific to your VCS, even if you're using web-based tools like ViewVC or ViewSVN (or github!).

Dan Davies Brackett
  • 9,811
  • 2
  • 32
  • 54
  • Worth noting that svn also has the politically correct synonym for blame: 'svn praise' :-) – Chris J Nov 03 '10 at 20:26
  • The right way is using whatever tool works best :) – Lev Nov 04 '10 at 05:13
  • Actually, for a long time, Git didn't include a `blame` tool. Linus Torvalds felt (and still does) that writing an open source system is a collaborative effort and singling out the person who authored a piece of code over, say, the person that tracked down the bug, figured out how to fix it, wrote the documentation for the feature, helped the author get the code accepted into mainline, etc. (in the case of "praise") or the person who introduced the bug over the reviewer who let it slip through and the maintainer who merged it (in the case of "blame") was unfair. But is Git broken? – Jörg W Mittag Nov 04 '10 at 10:45
  • @Jörg W Mittag I'm often much less interested in the committer than I am in the message, which usually provides intent for the change (like, a bugid). In that forensic sense, I'd say that yes git is broken for that usecase. – Dan Davies Brackett Nov 04 '10 at 17:19
1

I believe Trac offer a blame (annotate) mode, when used in conjonction with some VCS (like SVN or Mercurial)

For instance, the Mercurial plugin in Trac has support for visual blame annotations:

alt text

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250