]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
log2changes.pl: wrap long lines at 80 columns
authorDaniel Stenberg <daniel@haxx.se>
Fri, 11 Nov 2022 23:07:34 +0000 (00:07 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 15 Nov 2022 09:56:09 +0000 (10:56 +0100)
Also, only use author names in the output.

Fixes #9896
Reported-by: John Sherrill
Closes #9897

scripts/log2changes.pl

index 1af705758059dba957054a231000f26556703beb..ee8a753eb511b99d41501d1c0fa36b0567acbb3d 100755 (executable)
@@ -37,6 +37,18 @@ sub nicedate {
     return $date;
 }
 
+sub printmsg {
+    my ($p, $msg)=@_;
+    while(length($msg) > 77) {
+        print $p.substr($msg, 0, 77, "")."\n";
+        $p="  ";
+    }
+    if($msg eq "") {
+        $p = "";
+    }
+    print "$p$msg\n";
+}
+
 print
 '                                  _   _ ____  _
                               ___| | | |  _ \| |
@@ -47,7 +59,6 @@ print
                                   Changelog
 ';
 
-my $line;
 my $tag;
 while(<STDIN>) {
     my $l = $_;
@@ -61,44 +72,32 @@ while(<STDIN>) {
         }
     }
     elsif($l =~ /^Author: *(.*) +</) {
-        $a = $1;
-    }
-    elsif($l =~ /^Commit: *(.*) +</) {
         $c = $1;
     }
     elsif($l =~ /^CommitDate: (.*)/) {
         $date = nicedate($1);
     }
     elsif($l =~ /^(    )(.*)/) {
-        my $extra;
+        my $pref = "  ";
         if ($tag) {
             # Version entries have a special format
             print "\nVersion " . $tag." ($date)\n";
             $oldc = "";
             $tag = "";
         }
-        if($a ne $c) {
-            $extra=sprintf("\n- [%s brought this change]\n\n  ", $a);
-        }
-        else {
-            $extra="\n- ";
-        }
         if($co ne $oldco) {
             if($c ne $oldc) {
-                print "\n$c ($date)$extra";
+                print "\n$c ($date)\n\n";
             }
             else {
-                print "$extra";
+                print "\n";
             }
-            $line =0;
+            $pref = "- ";
         }
 
         $oldco = $co;
         $oldc = $c;
         $olddate = $date;
-        if($line++ && $2 ne "") {
-            print "  ";
-        }
-        print $2."\n";
+        printmsg($pref, $2);
     }
 }