[Python-apps-team] Bug#824512: project should be optional
Antoine Beaupré
anarcat at debian.org
Mon May 16 22:09:14 UTC 2016
Package: irker
Version: 2.17+dfsg-1
Severity: wishlist
Tags: upstream patch
right now, while irker hopes to require no configuration, the truth is
that it does: you need to setup the git hook, then some IRC configs. the
manual recommends:
[irker]
project = gpsd
color = ANSI
channels = irc://irc.freenode.net/gpsd
I always goof it up and forget to change the project, which means I
announce "gpsd" commits everywhere. Silly me.
I can't turn off the "project" part at all either: why is that
mandatory?
But even worse, if I *don't* specify it, irkerhook silently fails
without any warning, and without sending the notification. It's annoying
enough to configure all the things without having them fail silently.
There are 2 different places the code is failing me:
1. in irkerhook-git, it silently exits without warning if project is
missing
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 follow patch fixes issue #1, by delegating to the irkerhook the
control logic:
Index: debian/local/irkerhook-git
===================================================================
--- debian/local/irkerhook-git (révision 13218)
+++ debian/local/irkerhook-git (copie de travail)
@@ -2,11 +2,6 @@
set -e
-if [ -z "$(git config --get irker.project)" ]
-then
- exit 0
-fi
-
echo "sending IRC notification"
while read old new refname
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"
A.
-- System Information:
Debian Release: 8.4
APT prefers stable
APT policy: (500, 'stable'), (1, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_CA.UTF-8, LC_CTYPE=fr_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages irker depends on:
ii adduser 3.113+nmu3
ii init-system-helpers 1.22
pn python:any <none>
irker recommends no packages.
irker suggests no packages.
-- no debconf information
More information about the Python-apps-team
mailing list