From: Laurent Bachelier Date: Sun, 17 Feb 2013 00:57:54 +0000 (+0100) Subject: Extract commit dates X-Git-Tag: 1.18~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cd4b6d61ef2eee5e8aed33ac2f8e916619b8f0e1;p=irker.git Extract commit dates So they can be handled by the filter hook. For now, only git is handled. Signed-off-by: Eric S. Raymond --- 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):