Allow overriding the irkerhook template
From debian bug #824512 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824512)
Antoine Beaupré wrote
2. in irkerhook there is no way to disable the "project" field in the output
The rationale of the latter is that it's quite likely that there is only one repository for a small project. Having the project name copied there is redundant: look at the topic or the channel name! It takes up precious message space and shouldn't be mandatory.
It currently defaults to the repository path without .git
The following patch fixes # 2, by providing a way to override the template:
--- irker-2.17+dfsg.orig/irkerhook.py
+++ irker-2.17+dfsg/irkerhook.py
@@ -237,7 +237,7 @@ class GitExtractor(GenericExtractor):
self.channels = do("git config --get irker.channels")
self.email = do("git config --get irker.email")
self.tcp = do("git config --bool --get irker.tcp")
- self.template = '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
+ self.template = do("git config --get irker.template") or '%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s'
self.tinyifier = do("git config --get irker.tinyifier") or default_tinyifier
self.color = do("git config --get irker.color")
self.urlprefix = do("git config --get irker.urlprefix") or "gitweb"