summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2010-10-03 19:21:10 +0200
committerZac Medico <zmedico@gentoo.org>2010-10-03 12:18:05 -0700
commit3c90c56e2c7578ddab57c7006889bf50585f23e2 (patch)
treecdaeea2df6cf2c8486126b37e28a345af096a5da
parent91911ef2e9411be275a88bff0b414db0273426fd (diff)
downloadportage-3c90c56e2c7578ddab57c7006889bf50585f23e2.tar.gz
portage-3c90c56e2c7578ddab57c7006889bf50585f23e2.tar.bz2
portage-3c90c56e2c7578ddab57c7006889bf50585f23e2.zip
egencache --update-changelogs: Filter messages
Drop common commit message suffixes like 'git-svn-id' and repoman version note.
-rwxr-xr-xbin/egencache19
1 files changed, 15 insertions, 4 deletions
diff --git a/bin/egencache b/bin/egencache
index 1a6a0aa87..06df4f820 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -527,7 +527,7 @@ class GenChangeLogs(object):
changed = []
for n, l in enumerate(reversed(cinfo)):
if not l:
- body = cinfo[1:-n]
+ body = cinfo[1:-n-1]
break
else:
f = l.split()
@@ -563,17 +563,28 @@ class GenChangeLogs(object):
if wroteheader:
output.write('\n')
- # XXX: strip the repoman suffix note from the commit message
-
# strip '<cp>: ', '[<cp>] ', and similar
body[0] = re.sub(r'^\W*' + re.escape(cp) + r'\W+', '', body[0])
+ # strip trailing newline
+ if not body[-1]:
+ body = body[:-1]
+ # strip git-svn id
+ if body[-1].startswith('git-svn-id:') and not body[-2]:
+ body = body[:-2]
+ # strip the repoman version/manifest note
+ if body[-1] == ' (Signed Manifest commit)' or body[-1] == ' (Unsigned Manifest commit)':
+ body = body[:-1]
+ if body[-1].startswith('(Portage version:') and body[-1].endswith(')'):
+ body = body[:-1]
+ if not body[-1]:
+ body = body[:-1]
# don't break filenames on hyphens
self._wrapper.break_on_hyphens = False
output.write(self._wrapper.fill('%s; %s %s:' % (date, author, ', '.join(changed))))
# but feel free to break commit messages there
self._wrapper.break_on_hyphens = True
- output.write('\n'.join([''] + [self._wrapper.fill(x) for x in body]))
+ output.write('\n%s\n\n' % '\n'.join([self._wrapper.fill(x) for x in body]))
output.close()