Using Org-mode To Capture and Report Git Commits

Like most developers, Andrea Richiardi has a certain amount of logging and reporting he has to do to document his work. One such item is a report on the commits he’s made while working on various tickets. He wants to capture:

  1. The ticket number,
  2. The text of the commit description, and
  3. The time and date of the commit.

At the end of the week we wants to generate a report containing all this information.

He manages this with Org-mode and a bit of custom Elisp. He describes the solution in his post Build your productivity tools with org-mode. Almost all the work is done by the built-in Org capture and agenda functionality. Most of the Elisp is simply a couple of regular expressions that retrieve the ticket number and commit description. The only non-obvious Elisp deals with capturing the text of the commit buffer or, possibly, a selected region of text.

The template he uses for capturing the data formats it, adds some metadata, and stores it in an Org file. He has a custom agenda command to list the entries he’s captured that he can use to send the information on.

It’s a nice system that you may find useful but even if you don’t, it serves as an excellent example of how to leverage the built-in Org tools to make what might seem a complicated task easy.

This entry was posted in General and tagged , . Bookmark the permalink.