emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeff Kowalczyk <jtk@yahoo.com>
To: emacs-orgmode@gnu.org
Subject: Clocking time from git log
Date: Fri, 19 Jun 2009 23:29:17 -0400	[thread overview]
Message-ID: <pan.2009.06.20.03.29.16.505460@yahoo.com> (raw)

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	other threads:[~2009-06-20  3:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pan.2009.06.20.03.29.16.505460@yahoo.com \
    --to=jtk@yahoo.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).