emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Clocking time from git log


From: Jeff Kowalczyk
Subject: [Orgmode] Clocking time from git log
Date: Fri, 19 Jun 2009 23:29:17 -0400
User-agent: Pan/0.14.2.91 (As She Crawled Across the Table)

I would like to clock time in org mode from git commit logs. The simple
case I'd like to handle is continuous commit activity on a single
branch without merges, formatted as org-mode headings at a fixed level.

The following git log format provides a useful starting point for manual
editing:

  $ git log --reverse --format="** %s%n   CLOSED: [%ai]%n   :LOGBOOK:\
    %n   :CLOCK: [%P]--[%ai]%n   :END:%n   :PROPERTIES:\
    %n   :commit: %H%n   :END:%n%b"

  ** Commit log subject line.
     CLOSED: [2009-05-14 17:34:18 -0400]
     :LOGBOOK:
     :CLOCK: [parentsha1]--[2009-05-14 17:34:18 -0400]
     :END:
     :PROPERTIES:
     :commit: commitsha1
     :END:
  Commit body here.

Given the intersection of git and org-mode users here, can anyone
recommend methods in either git-log or org that would help with any of:

* Getting the author-time of parentsha1, which should also be the
  CLOSED time of the previous sibling, and/or the CLOSED time of a heading
  with a known value for property :commit:.

* Getting org to parse one of git's available timestamp formats (ISO
  8601, RFC 2822) and convert the text to org's default timestamp format.

* Prefixing all heading body text with ": " for preformatted text.

Thanks for any suggestions,
Jeff





reply via email to

[Prev in Thread] Current Thread [Next in Thread]