I was discussing comments vs. intention-revealing code with some folks on Twitter today and I realize that there’s a tool I take so much for granted I don’t even think about it any more. The tool is called VC-Annotate in Emacs, but some form of it should exist in every decent editor.

If you’re a programmer and you’re not using your editor’s revision control annotation features, I strongly recommend learning about them ASAP. They are an essential tool in understanding the story behind the code.

httpv://youtube.com/watch?v=rjnm-suxfRI

Published by Avdi Grimm

15 Comments

  1. Thanks for the tip Avdi – really powerful.

    Does anyone know of similar functionality in vim? Closest I could find was VCSCommand1 however I’m not sure it goes as far as Avdi does here.

    Reply
    • I use the Fugitive plugin for Vim. I love the convenience for git diff and blame.

      Reply
      • Yeah.. Tim Pope’s Fugitive does exactly that. Just type :Gblame in normal mode and you’ll see the exact thing what Avdi is showing here. You can open each commit shown in that view by pressing ‘o’.

        Reply
  2. vc-annotate brings me one step closer to Emacs for everything. Thanks for sharing!

    Reply
  3. Anyone know any for TextMate ?

    Reply
  4. […] information. From there you can drill down and get further details. Grimm has an excellent short video1 that demonstrates some of its […]

    Reply
  5. Just came across this. Never realised how much under-used VC is in my workflows. I’ll have to see if this works with Perforce as well. Thanks for the tip.

    BTW, what’s the colour scheme you’re using in there ?

    Reply
  6. Thanks for the tip. You don’t use magit? I found it a bit a slow sometimes.

    Reply
    • Magit is indispensable! Best ui for git anywhere.

      Reply
      • You use both vc-* and magit? What is vc-* doing better than magit? Love to hear your take on that 🙂

        Reply
        • There is actually very little overlap between the two. Magit is for managing a whole project under revision control. It’s what I use when I’m selecting files/hunks for a commit, for instance. Or pushing, pulling, rebasing—anything that takes effect project-wide.

          vc-mode, OTOH, is totally buffer/file-focused. It won’t show you the state of your whole project, but it will tell you quite a bit about the file you are currently looking at.

          In short: they are complementary!

          Reply
  7. Absolutely amazing! Avdi, you made my day! Thank you very much! Now I love emacs far more! Emacs rocks!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *