Gentoo Archives: gentoo-portage-dev

From: Mike Gilbert <floppym@g.o>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH] repoman: remove extra blank line in commit footer
Date: Fri, 13 Jan 2017 17:42:24
Message-Id: 20170113174218.546-1-floppym@gentoo.org
1 This results in cleaner/more compact commit messages when the author has
2 already included some "Field: value" pair in the commit message body.
3
4 This check simply looks for a colon in the last line of the commit
5 message body.
6
7 Before:
8 dev-libs/libfoo: fix something
9
10 Yada yada yada.
11
12 Gentoo-Bug: 123
13
14 Package-Manager: Portage-2.3.3, Repoman-2.3.1
15
16 After:
17 dev-libs/libfoo: fix something
18
19 Yada yada yada.
20
21 Gentoo-Bug: 123
22 Package-Manager: Portage-2.3.3, Repoman-2.3.1
23 ---
24 repoman/pym/repoman/actions.py | 8 ++++++--
25 1 file changed, 6 insertions(+), 2 deletions(-)
26
27 diff --git a/repoman/pym/repoman/actions.py b/repoman/pym/repoman/actions.py
28 index 189580ea2..58b00d494 100644
29 --- a/repoman/pym/repoman/actions.py
30 +++ b/repoman/pym/repoman/actions.py
31 @@ -128,6 +128,10 @@ class Actions(object):
32 myupdates, mymanifests, myremoved, mychanged, myautoadd,
33 mynew, commitmessage)
34
35 + lastline = commitmessage.splitlines()[-1]
36 + if not ':' in lastline:
37 + commitmessage += '\n'
38 +
39 commit_footer = self.get_commit_footer()
40 commitmessage += commit_footer
41
42 @@ -337,7 +341,7 @@ class Actions(object):
43 portage_version = "Unknown"
44 # Use new footer only for git (see bug #438364).
45 if self.vcs_settings.vcs in ["git"]:
46 - commit_footer = "\n\nPackage-Manager: Portage-%s, Repoman-%s" % (
47 + commit_footer = "\nPackage-Manager: Portage-%s, Repoman-%s" % (
48 portage.VERSION, VERSION)
49 if report_options:
50 commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
51 @@ -351,7 +355,7 @@ class Actions(object):
52 unameout += platform.processor()
53 else:
54 unameout += platform.machine()
55 - commit_footer = "\n\n"
56 + commit_footer = "\n"
57 if dco_sob:
58 commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
59 commit_footer += "(Portage version: %s/%s/%s" % \
60 --
61 2.11.0

Replies