Source Code Annotate Macro

Macro Monday – a new macro to dig into every Monday!

When working with source code, it’s often handy to know who last changed a
particular line of code – so you know who to point your finger at when s%!$
breaks. It just so happens there is a feature called *annotate* in the source
code control world that does exactly that.

## The Macro

This macro works for Git and Subversion (I’m lazy and haven’t added support for
other VCS – pull requests are welcome), which will run a scc annotate operation
using Komodo’s [Run Command][] service, parse the annotate output and place this
information in the left [editor margin].

Clicking on the annotate margin will launch the Komodo SCC History dialog for
that file.

## Screenshot

Note that the margin uses different colors to represent different commits, but
it doesn’t guarantee that two adjacant commits do not share the same color.

## Installation

To install the macro simply hit the “View Resource” and “Install Instructions”
links below.

Execute the macro by double-clicking on the macro in the toolbox, or use the
Invoke Tool (Ctrl+Shift+K) to search/execute “annotate”, or assign your own
keybinding to the macro. Run the macro again to remove the annotations.

## Related Materials

* [Run Command Tutorial][] – what you can do with run commands in Komodo
* [Komodo Developer Extension][] – play around with JavaScript or Python code in
the context of the Komodo window
* [Komodo Macro API][] – to programatically interact with the Komodo editor –
available to both Python and Javascript
* [Editor API][] – the Komodo editor provides a wrapper around the Scintilla API

[Run Command]:
[editor margin]:
[Run Command Tutorial]:
[Komodo Developer Extension]:
[Komodo Macro API]:
[Editor API]: