aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bachelier <laurent@bachelier.name>2013-02-17 01:57:54 +0100
committerEric S. Raymond <esr@thyrsus.com>2013-02-22 14:27:57 -0500
commitcd4b6d61ef2eee5e8aed33ac2f8e916619b8f0e1 (patch)
treeb29e19918179004c925f5283ddadb2dd77f663bf
parentVersion bump for 1.17 release. (diff)
downloadirker-cd4b6d61ef2eee5e8aed33ac2f8e916619b8f0e1.tar.xz
Extract commit dates
So they can be handled by the filter hook. For now, only git is handled. Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
-rwxr-xr-xirkerhook.py4
1 files changed, 4 insertions, 0 deletions
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):