From cd4b6d61ef2eee5e8aed33ac2f8e916619b8f0e1 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Sun, 17 Feb 2013 01:57:54 +0100 Subject: [PATCH] Extract commit dates So they can be handled by the filter hook. For now, only git is handled. Signed-off-by: Eric S. Raymond --- irkerhook.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/irkerhook.py b/irkerhook.py index 29434c7..09cb204 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -60,6 +60,8 @@ class Commit: self.files = None self.logmsg = None self.url = None + self.author_date = None + self.commit_date = None self.__dict__.update(extractor.__dict__) def __unicode__(self): "Produce a notification string from this commit." @@ -271,6 +273,8 @@ class GitExtractor(GenericExtractor): # for spammers' address harvesters - getting this wrong # would make the freenode #commits channel into harvester heaven. commit.author = commit.mail.split("@")[0] + commit.author_date, commit.commit_date = \ + do("git log -1 '--pretty=format:%ai|%ci' " + shellquote(commit.commit)).split("|") return commit class SvnExtractor(GenericExtractor): -- 2.26.2