1 |
On 01/14/2017 08:58 AM, Mike Gilbert wrote: |
2 |
> The second line in a git commit message is supposed to be blank. |
3 |
> |
4 |
> Before: |
5 |
> dev-libs/libfoo: fix another bug |
6 |
> Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
7 |
> |
8 |
> After: |
9 |
> dev-libs/libfoo: fix another bug |
10 |
> |
11 |
> Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
12 |
> --- |
13 |
> repoman/pym/repoman/actions.py | 5 +++-- |
14 |
> 1 file changed, 3 insertions(+), 2 deletions(-) |
15 |
> |
16 |
> diff --git a/repoman/pym/repoman/actions.py b/repoman/pym/repoman/actions.py |
17 |
> index 58b00d494..82c76b2fb 100644 |
18 |
> --- a/repoman/pym/repoman/actions.py |
19 |
> +++ b/repoman/pym/repoman/actions.py |
20 |
> @@ -128,8 +128,9 @@ class Actions(object): |
21 |
> myupdates, mymanifests, myremoved, mychanged, myautoadd, |
22 |
> mynew, commitmessage) |
23 |
> |
24 |
> - lastline = commitmessage.splitlines()[-1] |
25 |
> - if not ':' in lastline: |
26 |
> + lines = commitmessage.splitlines() |
27 |
> + lastline = lines[-1] |
28 |
> + if len(lines) == 1 or not ':' in lastline: |
29 |
|
30 |
Maybe a regular expression would be better, like this: |
31 |
|
32 |
if len(lines) == 1 or re.match(r'^\S+:\s', lastline) is None: |
33 |
|
34 |
|
35 |
> commitmessage += '\n' |
36 |
> |
37 |
> commit_footer = self.get_commit_footer() |
38 |
> |
39 |
|
40 |
|
41 |
-- |
42 |
Thanks, |
43 |
Zac |