]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - debian/scripts/misc/git-ubuntu-log
UBUNTU: [Debian] git-ubuntu-log -- prevent bug references being split
[mirror_ubuntu-zesty-kernel.git] / debian / scripts / misc / git-ubuntu-log
index 762fa28161913598f0673e2c3a87bcd527d87ff5..8b84911f18e7b84f32948112915980e16b09e9e5 100755 (executable)
@@ -7,6 +7,8 @@ import codecs
 import urllib.request
 import json
 
+import textwrap
+
 sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
 
 # Suck up the git log output and extract the information we need.
@@ -42,6 +44,9 @@ for line in sys.stdin:
         entry['ignore'] = True
 
 
+if entry and 'ignore' not in entry:
+    entries.append(entry)
+
 entries.reverse()
 
 # Go through the entries and clear out authors for upstream commits.
@@ -81,7 +86,7 @@ for bug in bugs:
         except urllib.error.HTTPError:
             title = 'INVALID or PRIVATE BUG'
 
-        title += ' (LP#' + bug + ')'
+        title += ' (LP###' + bug + ')'
 
     emit_title = True
     for entry in entries:
@@ -93,7 +98,16 @@ for bug in bugs:
                     print('')
                 emit_nl = True
 
-                print('  * ' + title)
+                title_lines = textwrap.wrap(title, 76)
+                print('  * ' + title_lines[0].replace('LP###', 'LP: #'))
+                for line in title_lines[1:]:
+                    line = line.replace('LP###', 'LP: #')
+                    print('    ' + line)
+
                 emit_title = False
-            print('    - ' + entry['subject'])
+            title_lines = textwrap.wrap(entry['subject'], 76)
+            print('    - ' + title_lines[0])
+            for line in title_lines[1:]:
+                line = line.replace('LP###', 'LP: #')
+                print('      ' + line)