OSDN Git Service

Improve gitlog2changelog.py (line boundary check)
authorTAMUKI Shoichi <tamuki@linet.gr.jp>
Fri, 2 May 2014 04:21:25 +0000 (13:21 +0900)
committerniwa-hideyuki <niwa.hideyuki@jp.fujitsu.com>
Sat, 3 May 2014 02:21:29 +0000 (11:21 +0900)
Improve line boundary check.  Also, add year to the author line.

Signed-off-by: TAMUKI Shoichi <tamuki@linet.gr.jp>
lxcf/script/gitlog2changelog.py

index ab839f2..647340b 100755 (executable)
@@ -2,7 +2,7 @@
 # Copyright 2008 Marcus D. Hanwell <marcus@cryos.org>
 # Distributed under the terms of the GNU General Public License v2 or later
 
-# Modified by TAMUKI Shoichi <tamuki@linet.gr.jp>
+# Modified by (C) 2012-2014 TAMUKI Shoichi <tamuki@linet.gr.jp>
 
 import os, re
 
@@ -78,7 +78,9 @@ for line in fin:
                                        if not message.endswith("\n"):
                                                message += "\n"
                                        messageItem = True
-                       if not message.endswith("\n"):
+                       if message.endswith("."):
+                               message += "  "
+                       elif not message.endswith("\n"):
                                message += " "
                        message += line.strip()
        # Collect the files for this commit. FIXME: Still need to add +/- to files
@@ -101,8 +103,8 @@ for line in fin:
                        commitSet = ""
                elif authorLine != prevAuthorLine:
                        # Write out the commit lines
-                       fout.write(commitSet)
-                       fout.write("\n\n" + authorLine + "\n")
+                       fout.write(commitSet + "\n")
+                       fout.write("\n" + authorLine + "\n")
                        commitSet = ""
 
                # Assemble the actual commit message line(s) and limit the line length