From: Eric S. Raymond Date: Fri, 28 Sep 2012 19:43:14 +0000 (-0400) Subject: Fix a bug in reporting of multi-line commits. X-Git-Tag: 1.1~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6f7f326ae8970bb3c98b7bdcfd502a434eab573e;p=irker.git Fix a bug in reporting of multi-line commits. --- diff --git a/NEWS b/NEWS index d6014ce..7f4a9ed 100644 --- a/NEWS +++ b/NEWS @@ -5,5 +5,7 @@ 1.1 @ 2012-09-28 Add a delay to avoid threads spinning on the empty-queue-check, eating CPU. + Fix a bug in reporting of multi-file commits. + diff --git a/irkerhook.py b/irkerhook.py index 25a10fb..15c67ff 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -73,7 +73,7 @@ tinyifier = "http://tinyurl.com/api-create.php?url=" import os, sys, commands, socket, urllib, json -version = "1.0" +version = "1.1" def do(command): return commands.getstatusoutput(command)[1] @@ -131,7 +131,8 @@ class GitExtractor: self.rev = self.commit[:12] # Extract the meta-information for the commit - self.files = do("git diff-tree -r --name-only '"+ self.commit +"' | sed -e '1d' -e 's-.*-&-'") + self.files = do("git diff-tree -r --name-only '"+ self.commit +"'") + self.files = " ".join(self.files.strip().split("\n")[1:]) metainfo = do("git log -1 '--pretty=format:%an <%ae>%n%s' " + self.commit) (self.author, self.logmsg) = metainfo.split("\n") # This discards the part of the author's address after @.