From: "Sebastian Pipping" <sping@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/userinfo-scripts:master commit in: /
Date: Sun, 11 Nov 2012 17:55:06 +0000 (UTC) [thread overview]
Message-ID: <1352656260.466c2c6b34a6a70b4f367c029b072b65b3bbb08e.sping@gentoo> (raw)
commit: 466c2c6b34a6a70b4f367c029b072b65b3bbb08e
Author: Sebastian Pipping <sebastian <AT> pipping <DOT> org>
AuthorDate: Sun Nov 11 17:49:01 2012 +0000
Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sun Nov 11 17:51:00 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/userinfo-scripts.git;a=commit;h=466c2c6b
Make aliases more flexible, add to aliases
---
git-identity-map.py | 38 +++++++++++++++++++++++++++++++++-----
1 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/git-identity-map.py b/git-identity-map.py
index 05dad60..c919a24 100755
--- a/git-identity-map.py
+++ b/git-identity-map.py
@@ -8,11 +8,31 @@ import xml.etree.ElementTree as ET # Python 2.5
import sys
-def produce_line(gentoo_nick, realname):
- line = '%s = %s <%s@gentoo.org>' % (gentoo_nick, realname, gentoo_nick)
+_PAST_GENTOO_ACCOUNT, _CHAT_OR_LOCAL_ONLY = range(2)
+
+
+_past_nicknames_for = {
+ 'chithanh': (
+ ('chithead', _CHAT_OR_LOCAL_ONLY),
+ ),
+ 'fauli': (
+ ('opfer', _PAST_GENTOO_ACCOUNT),
+ ),
+ 'stkn': (
+ ('aura', _CHAT_OR_LOCAL_ONLY),
+ ),
+}
+
+
+def _produce_line(svn_nick, realname, address):
+ line = '%s = %s <%s>' % (svn_nick, realname, address)
print(line.encode('utf-8'))
+def _gentoo_address(nick):
+ return '%s@gentoo.org' % nick
+
+
def main(args):
if len(args) != 2:
print('USAGE: %s GENTOO/xml/htdocs/proj/en/devrel/roll-call/userinfo.xml' % args[0])
@@ -29,10 +49,18 @@ def main(args):
location = user.find('location')
realname = user.find('realname').attrib['fullname'].strip()
- produce_line(svn_nick, realname)
+ _produce_line(svn_nick, realname, _gentoo_address(svn_nick))
+
+ past_nicknames = _past_nicknames_for.get(svn_nick, [])
+ for alias, kind in past_nicknames:
+ if kind == _PAST_GENTOO_ACCOUNT:
+ gentoo_nick=alias
+ elif kind == _CHAT_OR_LOCAL_ONLY:
+ gentoo_nick=svn_nick
+ else:
+ assert False, 'Invalid kind %s' % str(kind)
+ _produce_line(alias, realname, _gentoo_address(gentoo_nick))
- if svn_nick == 'fauli':
- produce_line('opfer', realname)
return 0
next reply other threads:[~2012-11-11 17:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-11 17:55 Sebastian Pipping [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-07-12 18:22 [gentoo-commits] proj/userinfo-scripts:master commit in: / Sebastian Pipping
2014-07-12 18:22 Sebastian Pipping
2014-06-22 23:26 Sebastian Pipping
2014-06-22 22:14 Sebastian Pipping
2014-06-15 19:00 Sebastian Pipping
2013-05-23 23:41 Sebastian Pipping
2013-05-07 0:41 Sebastian Pipping
2013-05-07 0:41 Sebastian Pipping
2012-11-11 20:59 Sebastian Pipping
2012-11-11 17:55 Sebastian Pipping
2012-05-06 16:17 Sebastian Pipping
2012-05-06 16:02 Sebastian Pipping
2012-05-06 15:32 Sebastian Pipping
2012-05-06 15:32 Sebastian Pipping
2012-03-25 0:47 Sebastian Pipping
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352656260.466c2c6b34a6a70b4f367c029b072b65b3bbb08e.sping@gentoo \
--to=sping@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox