]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: [Debian] git-ubuntu-log -- fix empty section formatting
authorAndy Whitcroft <apw@canonical.com>
Fri, 5 Feb 2016 17:39:13 +0000 (17:39 +0000)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
Signed-off-by: Andy Whitcroft <apw@canonical.com>
debian/scripts/misc/git-ubuntu-log

index de018aa5028bee6321ede2fdab5fe369c1dac7b8..fcf6ee0e353a005916680426cc4039802d4c7c51 100755 (executable)
@@ -52,12 +52,8 @@ for entry in entries:
 bugs.append('__packaging__')
 bugs.append('__mainline__')
 
-first = True
+emit_nl = False
 for bug in bugs:
-    if not first:
-        print('')
-    first = False
-
     if bug == '__packaging__':
         title = 'Miscellaneous Ubuntu changes'
     elif bug == '__mainline__':
@@ -80,11 +76,17 @@ for bug in bugs:
 
         title += ' (LP: #' + bug + ')'
 
-    print('  * ' + title)
-
+    emit_title = True
     for entry in entries:
         if (bug == '__packaging__' and 'bugs' not in entry and 'author' in entry) or \
            (bug == '__mainline__' and 'bugs' not in entry and 'author' not in entry) or \
            ('bugs' in entry and bug in entry['bugs']):
+            if emit_title:
+                if emit_nl:
+                    print('')
+                emit_nl = True
+
+                print('  * ' + title)
+                emit_title = False
             print('    - ' + entry['subject'])